From 32248e67ee1cd33de78b1988f87c608d8d0a7682 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 7 Dec 2022 11:30:14 -0700 Subject: [PATCH] Et2Dialog: Better non-modal styling --- api/js/etemplate/Et2Dialog/Et2Dialog.ts | 15 +++++++++++++++ api/templates/default/etemplate2.css | 4 ---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/api/js/etemplate/Et2Dialog/Et2Dialog.ts b/api/js/etemplate/Et2Dialog/Et2Dialog.ts index 9f3a099223..31acd21df7 100644 --- a/api/js/etemplate/Et2Dialog/Et2Dialog.ts +++ b/api/js/etemplate/Et2Dialog/Et2Dialog.ts @@ -222,6 +222,15 @@ export class Et2Dialog extends Et2Widget(SlotMixin(SlDialog)) border-top: 1px solid silver; margin-top: 0.5em; } + + /* Non-modal dialogs don't have an overlay */ + :host(:not([modal])) .dialog, :host(:not([modal])) .dialog__overlay { + pointer-events: none; + background: transparent; + } + :host(:not([modal])) .dialog__panel { + pointer-events: auto; + } ` ]; } @@ -990,6 +999,12 @@ export class Et2Dialog extends Et2Widget(SlotMixin(SlDialog)) listeners: { move: this._onMoveResize }, + modifiers: (this.modal ? [] : [ + interact.modifiers.restrict({ + restriction: 'parent', + endOnly: true + }) + ]) }); } diff --git a/api/templates/default/etemplate2.css b/api/templates/default/etemplate2.css index cb4566ab32..516953b115 100644 --- a/api/templates/default/etemplate2.css +++ b/api/templates/default/etemplate2.css @@ -788,10 +788,6 @@ et2-dialog .dialog--has_message { display: flex; } -/* Non-modal dialogs don't cover application tabs (add them to the app content div), not body */ -et2-dialog:not([modal])::part(base), et2-dialog:not([modal])::part(overlay) { - inset: 50px 0 0 0; -} /**