Skip to content

Commit ebf3977

Browse files
authored
Grid (Legacy): Fix for RTE drag and drop issue (closes #16591) (#20498)
* #16591- Fix RTE drag and drop issue in Grid Layout (Legacy) * Change case for variable
1 parent 388e5f9 commit ebf3977

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/Umbraco.Web.UI.Client/src/common/directives/components/grid/grid.rte.directive.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ angular.module("umbraco.directives")
8282
//custom initialization for this editor within the grid
8383
editor.on('init', function (e) {
8484

85+
//register global variable to re-save the dragged RTE settings in the controller
86+
editor.settings = baseLineConfigObj;
87+
8588
// Used this init event - as opposed to property init_instance_callback
8689
// to turn off the loader
8790
scope.isLoading = false;

src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.controller.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ angular.module("umbraco")
7575
ui.item.find(".umb-rte").each(function (key, value) {
7676
// remove all RTEs in the dragged row and save their settings
7777
var rteId = value.id;
78-
var editor = _.findWhere(tinyMCE.editors, { id: rteId });
78+
var editor = _.findWhere(tinyMCE.get() , { id: rteId });
7979
if (editor) {
8080
draggedRteSettings[rteId] = editor.settings;
8181
}
@@ -92,7 +92,7 @@ angular.module("umbraco")
9292
var rteId = value.id;
9393
var settings = draggedRteSettings[rteId];
9494
if (!settings) {
95-
var editor = _.findWhere(tinyMCE.editors, { id: rteId });
95+
var editor = _.findWhere(tinyMCE.get() , { id: rteId });
9696
if (editor) {
9797
settings = editor.settings;
9898
}
@@ -189,7 +189,7 @@ angular.module("umbraco")
189189
if ($.inArray(rteId, notIncludedRte) < 0) {
190190

191191
// remember this RTEs settings, cause we need to update it later.
192-
var editor = _.findWhere(tinyMCE.editors, { id: rteId })
192+
var editor = _.findWhere(tinyMCE.get(), { id: rteId })
193193
if (editor) {
194194
draggedRteSettings[rteId] = editor.settings;
195195
}
@@ -203,9 +203,8 @@ angular.module("umbraco")
203203
var rteId = $(this).attr("id");
204204

205205
if ($.inArray(rteId, notIncludedRte) < 0) {
206-
207206
// remember this RTEs settings, cause we need to update it later.
208-
var editor = _.findWhere(tinyMCE.editors, { id: rteId })
207+
var editor = _.findWhere(tinyMCE.get() , { id: rteId })
209208
if (editor) {
210209
draggedRteSettings[rteId] = editor.settings;
211210
}
@@ -236,7 +235,7 @@ angular.module("umbraco")
236235
var rteId = value.id;
237236

238237
// remember this RTEs settings, cause we need to update it later.
239-
var editor = _.findWhere(tinyMCE.editors, { id: rteId });
238+
var editor = _.findWhere(tinyMCE.get() , { id: rteId });
240239

241240
// save the dragged RTE settings
242241
if (editor) {
@@ -258,7 +257,7 @@ angular.module("umbraco")
258257
var rteId = value.id;
259258
if ($.inArray(rteId, notIncludedRte) < 0) {
260259

261-
var editor = _.findWhere(tinyMCE.editors, { id: rteId });
260+
var editor = _.findWhere(tinyMCE.get() , { id: rteId });
262261
if (editor) {
263262
draggedRteSettings[rteId] = editor.settings;
264263
}

0 commit comments

Comments
 (0)