From 65018524ccfcdff8b60a49d30b099c6cbffdc31e Mon Sep 17 00:00:00 2001 From: Dave Macaulay Date: Mon, 26 Nov 2018 16:02:34 -0600 Subject: [PATCH 1/2] MC-3812: Text/Banner - Stage Inline Editor becomes focused and editable after clicking Save button on Edit Form MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use correct API for setting content to ensure unexpected focusing doesn’t occur --- lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js index ede8dd2081fdf..2d7ea07cd823e 100644 --- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js +++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js @@ -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); }, /** From 3ebea0e0ba2ea9bd7ab4e56224bea9086b563770 Mon Sep 17 00:00:00 2001 From: Dave Macaulay Date: Fri, 30 Nov 2018 15:45:41 -0600 Subject: [PATCH 2/2] MC-3812: Text/Banner - Stage Inline Editor becomes focused and editable after clicking Save button on Edit Form - Resolve issue with fixRangeSelection function --- lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js index 2d7ea07cd823e..ccfc82dcb0b75 100644 --- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js +++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js @@ -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 = '\uFEFF'; selection.setContent(markerHtml); marker = dom.get('mce_marker');