Fix an issue with empty mediatag widgets in pads

pull/1/head
yflory 6 years ago
parent 947c9c5e40
commit f538a05044

@ -497,6 +497,10 @@ define([
userDocStateDom.normalize(); userDocStateDom.normalize();
inner.normalize(); inner.normalize();
$(userDocStateDom).find('span[data-cke-display-name="media-tag"]:empty').each(function (i, el) {
$(el).remove();
});
var patch = (DD).diff(inner, userDocStateDom); var patch = (DD).diff(inner, userDocStateDom);
(DD).apply(inner, patch); (DD).apply(inner, patch);
@ -530,6 +534,10 @@ define([
return str; return str;
}); });
framework.setContentGetter(function () { framework.setContentGetter(function () {
$(inner).find('span[data-cke-display-name="media-tag"]:empty').each(function (i, el) {
$(el).remove();
});
displayMediaTags(framework, inner, mediaTagMap); displayMediaTags(framework, inner, mediaTagMap);
inner.normalize(); inner.normalize();
return Hyperjson.fromDOM(inner, shouldSerialize, hjsonFilters); return Hyperjson.fromDOM(inner, shouldSerialize, hjsonFilters);

Loading…
Cancel
Save