#125 - FIX: disconnect tinyMCE while dragging

By disconnecting the tinyMCE it won't trigger a recreate after drag and dropping, so you won't wind up with multiple htmleditors.
This commit is contained in:
torleif 2016-06-14 10:21:58 +12:00 committed by GitHub
parent 90d6402185
commit 1719ee3248

View File

@ -20,9 +20,23 @@
$(this).find('.usedWidgets').sortable({
opacity: 0.6,
handle: '.handle',
update: function(e, ui) {parentRef.updateWidgets(e, ui)},
update: function (e, ui) {
parentRef.updateWidgets(e, ui)
},
placeholder: 'ui-state-highlight',
forcePlaceholderSize: true
forcePlaceholderSize: true,
start: function (e, ui) {
htmleditors = $(e.srcElement).closest('.Widget').find('textarea.htmleditor');
$.each(htmleditors, function (k, i) {
tinyMCE.execCommand('mceRemoveControl', false, $(i).attr('id'));
})
},
stop: function (e, ui) {
htmleditors = $(e.srcElement).closest('.Widget').find('textarea.htmleditor');
$.each(htmleditors, function (k, i) {
tinyMCE.execCommand('mceAddControl', true, $(i).attr('id'));
})
}
});
// Figure out maxid, this is used when creating new widgets