From: Coleman Watts Date: Wed, 30 Jul 2014 09:33:29 +0000 (+0100) Subject: CRM-15053 - Fix unsaved change warning in profile designer dialog X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=23716b457d5aa1d6e1511d15d93854ea7b2ecec9;p=civicrm-core.git CRM-15053 - Fix unsaved change warning in profile designer dialog --- diff --git a/js/view/crm.designer.js b/js/view/crm.designer.js index daf8aec41b..07501e6b8f 100644 --- a/js/view/crm.designer.js +++ b/js/view/crm.designer.js @@ -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(); @@ -57,6 +58,10 @@ 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({