Merge pull request #1035 from GiantRobot/CRM-12720
[civicrm-core.git] / js / view / crm.designer.js
index f5631f1a72cf3393b28917e4c4cdb3264ae38d9c..9077eb39bf081c6d92ba7dd6b719c473e20fafea 100644 (file)
@@ -20,7 +20,7 @@
     result._collection = this.collection;
     result._options = this.options;
     return result;
-  }
+  };
 
   /**
    * Display a dialog window with an editable form for a UFGroupModel
@@ -99,6 +99,8 @@
             });
           }
           designerDialog.undoState = false;
+          // CRM-12188
+          CRM.designerApp.DetachedProfiles = [];
         },
         close: function() {
           window.onbeforeunload = designerDialog.oldOnBeforeUnload;
               return false;
             });
           }
+          // CRM-12188
+          CRM.designerApp.restorePreviewArea();
         },
         resize: function() {
           CRM.designerApp.vent.trigger('resize');
       }
       var $dialog = this.$el.closest('.crm-designer-dialog'); // FIXME use events
       $dialog.block({message: 'Loading...', theme: true});
+      // CRM-12188
+      CRM.designerApp.clearPreviewArea();
       $.ajax({
         url: CRM.url("civicrm/ajax/inline"),
         type: 'POST',