Merge pull request #3691 from eileenmcnaughton/master
[civicrm-core.git] / 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({