modal set element change
This commit is contained in:
@@ -314,6 +314,9 @@ class ModalView extends View {
|
||||
this.dialog.close();
|
||||
}
|
||||
|
||||
// Otherwise, re-render won't work.
|
||||
this.element = undefined;
|
||||
|
||||
this.isCollapsed = false;
|
||||
|
||||
$(this.containerSelector).remove();
|
||||
@@ -372,7 +375,6 @@ class ModalView extends View {
|
||||
this.containerElement = document.querySelector(this.containerSelector);
|
||||
|
||||
this.setElement(this.containerSelector + ' .body');
|
||||
|
||||
this.bodyElement = this.element;
|
||||
|
||||
// @todo Review that the element is set back to the container afterwards.
|
||||
@@ -380,6 +382,10 @@ class ModalView extends View {
|
||||
});
|
||||
|
||||
this.on('after:render', () => {
|
||||
// Trick to delegate events for the whole modal.
|
||||
this.element = undefined;
|
||||
this.setElement(this.containerSelector);
|
||||
|
||||
$(this.containerSelector).show();
|
||||
|
||||
this.dialog.show();
|
||||
@@ -397,8 +403,6 @@ class ModalView extends View {
|
||||
if (this.getParentView()) {
|
||||
this.getParentView().trigger('modal-shown');
|
||||
}
|
||||
|
||||
//this.setElement(this.containerSelector);
|
||||
});
|
||||
|
||||
this.once('remove', () => {
|
||||
|
||||
@@ -55,6 +55,8 @@ class PopupNotificationView extends View {
|
||||
(this.getConfig().get('popupNotificationSound') || this.soundPath);
|
||||
|
||||
this.on('render', () => {
|
||||
this.element = undefined;
|
||||
|
||||
$(containerSelector).remove();
|
||||
|
||||
const className = 'popup-notification-' + Espo.Utils.toDom(this.type);
|
||||
|
||||
Reference in New Issue
Block a user