Merge pull request #7167 from umbraco/v8/bugfix/7147-fix-losing-content-when-using-embed-in-RTE

Embed function in RTE removes previous content from RTE
This commit is contained in:
Warren Buckley
2019-11-19 09:44:44 +00:00
committed by GitHub

View File

@@ -543,11 +543,11 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
'contenteditable': false
},
embed.preview);
if (activeElement) {
// 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 {
} else {
editor.selection.setNode(wrapper);
}
},