Skip to content
Snippets Groups Projects
Commit 4151fff2 authored by colemanw's avatar colemanw
Browse files

Temp fix for duplicate dom ids CRM-12188

parent 3af02c86
No related branches found
No related tags found
No related merge requests found
......@@ -9,4 +9,23 @@ cj(document).ready(function($) {
*/
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()
});
});
};
CRM.designerApp.restorePreviewArea = function() {
$.each(CRM.designerApp.DetachedProfiles, function() {
$(this.parent).append(this.item);
});
};
});
......@@ -99,6 +99,8 @@
});
}
designerDialog.undoState = false;
// CRM-12188
CRM.designerApp.DetachedProfiles = [];
},
close: function() {
window.onbeforeunload = designerDialog.oldOnBeforeUnload;
......@@ -113,6 +115,8 @@
return false;
});
}
// CRM-12188
CRM.designerApp.restorePreviewArea();
},
resize: function() {
CRM.designerApp.vent.trigger('resize');
......@@ -241,6 +245,8 @@
}
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',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment