modal set element change

This commit is contained in:
Yuri Kuznetsov
2024-11-27 11:25:17 +02:00
parent b395773e5b
commit 3559978dc1
2 changed files with 9 additions and 3 deletions
+7 -3
View File
@@ -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', () => {
+2
View File
@@ -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);