Skip to content

Commit

Permalink
Merge pull request #3535 from magento-obsessive-owls/MC-3812-text-ban…
Browse files Browse the repository at this point in the history
…ner-inline-focus

[Owls] MC-3812: Text/Banner - Stage Inline Editor becomes focused and editable after clicking Save button on Edit Form
  • Loading branch information
joanhe authored Jan 11, 2019
2 parents d7ac52b + b0ebd4a commit d1f9c6b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ define([
* @param {String} content
*/
setContent: function (content) {
this.get(this.getId()).execCommand('mceSetContent', false, content);
this.get(this.getId()).setContent(content);
},

/**
Expand Down Expand Up @@ -559,10 +559,12 @@ define([
var selection = editor.selection,
dom = editor.dom,
rng = dom.createRng(),
doc = editor.getDoc(),
markerHtml,
marker;

if (!selection.getContent().length) {
// Validate the range we're trying to fix is contained within the current editors document
if (!selection.getContent().length && jQuery.contains(doc, selection.getRng().startContainer)) {
markerHtml = '<span id="mce_marker" data-mce-type="bookmark">\uFEFF</span>';
selection.setContent(markerHtml);
marker = dom.get('mce_marker');
Expand Down

0 comments on commit d1f9c6b

Please sign in to comment.