mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
Et2Dialog fixes
- Fix noCloseButton attribute was not implemented - Fix hideOnExcape=false still allowed closing on escape - Fix using Et2Dialog.BUTTONS_OK showed no buttons
This commit is contained in:
parent
65b239ca2c
commit
f4699543c3
@ -235,14 +235,23 @@ export class Et2Dialog extends Et2Widget(SlotMixin(SlDialog))
|
|||||||
|
|
||||||
/* Non-modal dialogs don't have an overlay */
|
/* Non-modal dialogs don't have an overlay */
|
||||||
|
|
||||||
:host(:not([isModal])) .dialog, :host(:not([isModal])) .dialog__overlay {
|
:host(:not([ismodal])) .dialog, :host(:not([isModal])) .dialog__overlay {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
:host(:not([isModal])) .dialog__panel {
|
|
||||||
|
:host(:not([ismodal])) .dialog__panel {
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Hide close button when set */
|
||||||
|
|
||||||
|
:host([noclosebutton]) .dialog__close {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Button alignments */
|
||||||
|
|
||||||
::slotted([align="left"]) {
|
::slotted([align="left"]) {
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
order: -1;
|
order: -1;
|
||||||
@ -311,7 +320,7 @@ export class Et2Dialog extends Et2Widget(SlotMixin(SlDialog))
|
|||||||
/**
|
/**
|
||||||
* When set to true it removes the close button from dialog's header
|
* When set to true it removes the close button from dialog's header
|
||||||
*/
|
*/
|
||||||
noCloseButton: Boolean
|
noCloseButton: {type: Boolean, reflect: true}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -424,9 +433,17 @@ export class Et2Dialog extends Et2Widget(SlotMixin(SlDialog))
|
|||||||
// Prevent close if they click the overlay when the dialog is modal
|
// Prevent close if they click the overlay when the dialog is modal
|
||||||
this.addEventListener('sl-request-close', event =>
|
this.addEventListener('sl-request-close', event =>
|
||||||
{
|
{
|
||||||
|
// Prevent close on clicking somewhere else
|
||||||
if(this.isModal && event.detail.source === 'overlay')
|
if(this.isModal && event.detail.source === 'overlay')
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Prevent close on escape
|
||||||
|
if(!this.hideOnEscape && event.detail.source === 'keyboard')
|
||||||
|
{
|
||||||
|
event.preventDefault();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -871,7 +888,8 @@ export class Et2Dialog extends Et2Widget(SlotMixin(SlDialog))
|
|||||||
|
|
||||||
_buttonsTemplate()
|
_buttonsTemplate()
|
||||||
{
|
{
|
||||||
if(!this.buttons)
|
// No buttons set, but careful with BUTTONS_OK
|
||||||
|
if(!this.buttons && this.buttons !== Et2Dialog.BUTTONS_OK)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user