Skip to content

Commit

Permalink
Merge pull request #9 from schmids/fix-core-bug-for-wysiwyg-and-paged…
Browse files Browse the repository at this point in the history
…esigner

Fix Magento 2 Core Bug for loading WYSIWYG editor in DOM. Fix pagedes…
  • Loading branch information
sydekumf committed Apr 21, 2017
2 parents 90c87d5 + 712055d commit 5ee09aa
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions view/adminhtml/web/js/page_designer.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,30 @@ define([
};
};

// override TinyMCE 'setup' function for fix PageDesigner and WYSIWYG editor bug
tinyMceWysiwygSetup.prototype.setup = function (mode) {
if (this.config.widget_plugin_src) {
tinyMCE.PluginManager.load('magentowidget', this.config.widget_plugin_src);
}

if (this.config.plugins) {
this.config.plugins.each(function (plugin) {
tinyMCE.PluginManager.load(plugin.name, plugin.src);
});
}

/**
* Magento 2 Core Bug
* Load TinyMce Editor in dom
* BugFix for PageDesigner
*/
if (jQuery.isReady) {
tinyMCE.dom.Event.domLoaded = true;
}

tinyMCE.init(this.getSettings(mode));
};

// preserve original function
if (!MediabrowserUtility.openDialog_original) {
MediabrowserUtility.openDialog_original = MediabrowserUtility.openDialog;
Expand Down

0 comments on commit 5ee09aa

Please sign in to comment.