Skip to content

EspoCRM – Open Source CRM Application

Confirm leave out set on full-form

Yurii04d061cdd2ef
diff --git a/client/src/views/modals/edit.js b/client/src/views/modals/edit.js
index 123280d8a5..d76257c9c5 100644
--- a/client/src/views/modals/edit.js
+++ b/client/src/views/modals/edit.js
@@ -499,8 +499,7 @@ class EditModalView extends ModalView {
router.dispatch(this.scope, 'create', options);
router.navigate(url, {trigger: false});
}, 10);
- }
- else {
+ } else {
url = this.options.fullFormUrl || `#${this.scope}/edit/${this.id}`;
attributes = this.getRecordView().fetch();
@@ -526,8 +525,15 @@ class EditModalView extends ModalView {
}, 10);
}
+ const isChanged = this.getRecordView().hasChanged();
+
this.trigger('leave');
this.dialog.close();
+
+ if (isChanged) {
+ // Establish for the full-form view.
+ this.getRouter().confirmLeaveOut = true;
+ }
}
async beforeCollapse() {