mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
Handle appendTo attribute used in legacy dialog properly
This commit is contained in:
parent
0758e17d24
commit
36f41a9470
@ -220,6 +220,7 @@ export class Et2Dialog extends Et2Widget(ScopedElementsMixin(SlotMixin(LionDialo
|
||||
* Automatically destroy the dialog when it closes. Set to false to keep the dialog around.
|
||||
*/
|
||||
destroy_on_close: Boolean,
|
||||
appendTo: String
|
||||
}
|
||||
}
|
||||
|
||||
@ -435,7 +436,7 @@ export class Et2Dialog extends Et2Widget(ScopedElementsMixin(SlotMixin(LionDialo
|
||||
get value() : Object
|
||||
{
|
||||
let value = this.__value;
|
||||
if(this._template_widget)
|
||||
if(this._template_widget && this._template_widget.widgetContainer)
|
||||
{
|
||||
value = this._template_widget.getValues(this._template_widget.widgetContainer);
|
||||
}
|
||||
|
@ -88,6 +88,27 @@ export class et2_dialog extends Et2Dialog
|
||||
return super._getButtons();
|
||||
}
|
||||
|
||||
_onOpen()
|
||||
{
|
||||
super._onOpen();
|
||||
|
||||
// move the overlay dialog into appendTo dom since we want it to be shown in that container
|
||||
if (this.appendTo)
|
||||
{
|
||||
document.getElementsByClassName(this.appendTo.replace('.',''))[0].appendChild(this._cachedOverlayContentNode);
|
||||
}
|
||||
}
|
||||
|
||||
_onClose(ev: PointerEvent)
|
||||
{
|
||||
// revert the moved container back to its original position in order to be able to teardown the overlay properly
|
||||
if (this.appendTo)
|
||||
{
|
||||
document.getElementsByClassName('global-overlays__overlay-container')[0].appendChild(this._cachedOverlayContentNode);
|
||||
}
|
||||
super._onClose(ev);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @returns {any}
|
||||
|
Loading…
Reference in New Issue
Block a user