mirror of
https://github.com/silverstripe/silverstripe-widgets
synced 2024-10-22 15:05:54 +00:00
#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:
parent
90d6402185
commit
1719ee3248
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user