Fixed bug in U4-6593 - After sort, reset the TinyMCE editors with previous settings

This commit is contained in:
Allyen
2015-06-17 14:57:15 +02:00
parent 52c33055af
commit eaaccdad75

View File

@@ -129,6 +129,9 @@ angular.module("umbraco")
},
start: function (e, ui) {
// reset dragged RTE settings in case a RTE isn't dragged
draggedRteSettings = undefined;
ui.item.find('.mceNoEditor').each(function () {
notIncludedRte = [];
@@ -148,12 +151,14 @@ angular.module("umbraco")
}
});
$timeout(function () {
// reconstruct the dragged RTE
tinyMCE.init(draggedRteSettings);
// reconstruct the dragged RTE (could be undefined when dragging something else than RTE)
if (draggedRteSettings !== undefined) {
tinyMCE.init(draggedRteSettings);
}
_.forEach(notIncludedRte, function (id) {
// reset all the other RTEs
if (id != draggedRteSettings.id) {
if (draggedRteSettings === undefined || id != draggedRteSettings.id) {
var rteSettings = _.findWhere(tinyMCE.editors, { id: id }).settings;
tinyMCE.execCommand('mceRemoveEditor', false, id);
tinyMCE.init(rteSettings);