CRM-15053 - Fix unsaved change warning in profile designer dialog
authorColeman Watts <coleman@civicrm.org>
Wed, 30 Jul 2014 09:33:29 +0000 (10:33 +0100)
committerColeman Watts <coleman@civicrm.org>
Wed, 30 Jul 2014 09:33:29 +0000 (10:33 +0100)
js/view/crm.designer.js

index daf8aec41b9b6b3054c3bf3add40dc0357f2a241..07501e6b8ff340ef318e35909b5534cf46a76f12 100644 (file)
@@ -49,6 +49,7 @@
 
     initialize: function(options) {
       CRM.designerApp.vent.on('ufUnsaved', this.onUfChanged, this);
+      CRM.designerApp.vent.on('ufSaved', this.onUfSaved, this);
     },
     onClose: function() {
       this.undoAlert && this.undoAlert.close && this.undoAlert.close();
     onUfChanged: function(isUfUnsaved) {
       this.isUfUnsaved = isUfUnsaved;
     },
+    onUfSaved: function() {
+      CRM.designerApp.vent.off('ufUnsaved', this.onUfChanged, this);
+      this.isUfUnsaved = false;
+    },
     onRender: function() {
       var designerDialog = this;
       designerDialog.$el.dialog({