fix(modal): modals are never destroyed
This commit is contained in:
parent
d72a937d0f
commit
53dab90810
@ -72,16 +72,7 @@ export class Modal {
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this._eventManager.cleanUp();
|
||||
if (this._closerElement !== undefined)
|
||||
this._closerElement.remove();
|
||||
if(this._triggerElement !== undefined)
|
||||
this._triggerElement.classList.remove(MODAL_TRIGGER_CLASS);
|
||||
if(this._modalsWrapper !== undefined)
|
||||
this._modalsWrapper.remove();
|
||||
if(this._modalOverlay !== undefined)
|
||||
this._modalOverlay.remove();
|
||||
this._element.classList.remove(MODAL_INITIALIZED_CLASS, MODAL_CLASS);
|
||||
throw new Error('Destroying modals is not possible.');
|
||||
}
|
||||
|
||||
_ensureModalWrapper() {
|
||||
@ -164,7 +155,6 @@ export class Modal {
|
||||
this._modalsWrapper.classList.remove(MODALS_WRAPPER_OPEN_CLASS);
|
||||
|
||||
document.removeEventListener('keyup', this._onKeyUp);
|
||||
this._app.utilRegistry.destroyAll(this._element);
|
||||
};
|
||||
|
||||
_fillModal(url) {
|
||||
|
||||
Reference in New Issue
Block a user