CRM-15578 - crmMailing(AB) - Submission & status tracking
[civicrm-core.git] / js / crm.designerapp.js
index a3001ac7f1d69724ea98bb94e113690d47698fe3..840d98a8e9b753d6119a00bc5cfbb994045ab8e9 100644 (file)
@@ -1,31 +1,33 @@
-cj(document).ready(function($) {
-  /**
-   * FIXME we depend on this being a global singleton, mainly to facilitate vents
-   *
-   * vents:
-   * - resize: the size/position of widgets should be adjusted
-   * - ufUnsaved: any part of a UFGroup was changed; args: (is_changed:bool)
-   * - formOpened: a toggleable form (such as a UFFieldView or a UFGroupView) has been opened
-   */
-  CRM.designerApp = new Backbone.Marionette.Application();
+(function ($, _) {
+  $(function () {
+    /**
+     * FIXME we depend on this being a global singleton, mainly to facilitate vents
+     *
+     * vents:
+     * - resize: the size/position of widgets should be adjusted
+     * - ufUnsaved: any part of a UFGroup was changed; args: (is_changed:bool)
+     * - formOpened: a toggleable form (such as a UFFieldView or a UFGroupView) has been opened
+     */
+    CRM.designerApp = new Backbone.Marionette.Application();
 
-  /**
-   * FIXME: Workaround for problem that having more than one instance
-   * of a profile on the page will result in duplicate DOM ids.
-   * @see CRM-12188
-   */
-  CRM.designerApp.clearPreviewArea = function() {
-    $('.crm-profile-selector-preview-pane > .crm-form-block').each(function() {
-      var parent = $(this).parent();
-      CRM.designerApp.DetachedProfiles.push({
-        parent: parent,
-        item: $(this).detach()
+    /**
+     * FIXME: Workaround for problem that having more than one instance
+     * of a profile on the page will result in duplicate DOM ids.
+     * @see CRM-12188
+     */
+    CRM.designerApp.clearPreviewArea = function () {
+      $('.crm-profile-selector-preview-pane > *').each(function () {
+        var parent = $(this).parent();
+        CRM.designerApp.DetachedProfiles.push({
+          parent: parent,
+          item: $(this).detach()
+        });
       });
-    });
-  };
-  CRM.designerApp.restorePreviewArea = function() {
-    $.each(CRM.designerApp.DetachedProfiles, function() {
-      $(this.parent).append(this.item);
-    });
-  };
-});
+    };
+    CRM.designerApp.restorePreviewArea = function () {
+      $.each(CRM.designerApp.DetachedProfiles, function () {
+        $(this.parent).append(this.item);
+      });
+    };
+  });
+})(CRM.$, CRM._);