forked from civicrm/civicrm-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrm.designerapp.js
33 lines (32 loc) · 1.12 KB
/
crm.designerapp.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(function ($, _, Backbone) {
$(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 > *').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.$, CRM._, CRM.BB);