Skip to content

Commit

Permalink
Fix issues inserting Widgets with nested WYSIWYGs
Browse files Browse the repository at this point in the history
This PR is a potential fix for issues magento#19742 and magento#13409 (Thanks to @EduardTd for pointing me in the right direction).

I've tested this briefly in my own install and it appears to resolve the issue. Submitting this PR so that the issue can be tested fully.
  • Loading branch information
molovo authored Jan 10, 2019
1 parent d7ac52b commit 3bcf0d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/web/mage/adminhtml/wysiwyg/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ define([
parameters: params,
onComplete: function (transport) {
try {
editor = wysiwyg.activeEditor();
editor = tinyMCE.get(this.widgetTargetId);

widgetTools.onAjaxSuccess(transport);
widgetTools.dialogWindow.modal('closeModal');
Expand All @@ -469,7 +469,7 @@ define([
editor.selection.select(activeNode);
editor.selection.setContent(transport.responseText);
} else if (this.bMark) {
wysiwyg.activeEditor().selection.moveToBookmark(this.bMark);
editor.selection.moveToBookmark(this.bMark);
}
}

Expand Down Expand Up @@ -513,7 +513,7 @@ define([
* @return {null|wysiwyg.Editor|*}
*/
getWysiwyg: function () {
return wysiwyg.activeEditor();
return tinyMCE.get(this.widgetTargetId);
},

/**
Expand Down

0 comments on commit 3bcf0d8

Please sign in to comment.