From 5c160f6390c2f63d861746ff07782cd2d01d153b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Mon, 18 Nov 2019 14:20:44 +0100 Subject: [PATCH 1/2] Only replace content by EmbedItem if the selected content is of type EmbedItem. --- .../src/common/services/tinymce.service.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index 4d4f8792cf..f6c0f94edd 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -543,11 +543,11 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s 'contenteditable': false }, embed.preview); - - if (activeElement) { + + // Only replace if actieElement is an Embed element. + if (activeElement && activeElement.nodeName.toUpperCase() === "DIV" && activeElement.classList.contains("embeditem")){ activeElement.replaceWith(wrapper); // directly replaces the html node - } - else { + } else { editor.selection.setNode(wrapper); } }, From 7c1af34b3e36ef38943da096597b05f7bc5e545f Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 19 Nov 2019 08:58:00 +0000 Subject: [PATCH 2/2] Update src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js --- .../src/common/services/tinymce.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index f6c0f94edd..b0941bd5ad 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -544,7 +544,7 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s }, embed.preview); - // Only replace if actieElement is an Embed element. + // Only replace if activeElement is an Embed element. if (activeElement && activeElement.nodeName.toUpperCase() === "DIV" && activeElement.classList.contains("embeditem")){ activeElement.replaceWith(wrapper); // directly replaces the html node } else {