Merge pull request #3691 from eileenmcnaughton/master
[civicrm-core.git] / js / view / crm.designer.js
index 077f0a221afd0188d9248ffabf9309d43b22c8a9..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({
         return;
       }
       var $dialog = this.$el.closest('.crm-designer-dialog'); // FIXME use events
-      $dialog.block({message: 'Saving...', theme: true});
+      $dialog.block();
       var profile = ufGroupModel.toStrictJSON();
       profile["api.UFField.replace"] = {values: ufGroupModel.getRel('ufFieldCollection').toSortedJSON(), 'option.autoweight': 0};
       CRM.api('UFGroup', 'create', profile, {
         return;
       }
       var $dialog = this.$el.closest('.crm-designer-dialog'); // FIXME use events
-      $dialog.block({message: 'Loading...', theme: true});
+      $dialog.block();
       // CRM-12188
       CRM.designerApp.clearPreviewArea();
       $.post(CRM.url("civicrm/ajax/inline"), {