Fix anchors in rich text readonly

pull/1/head
yflory 4 years ago
parent b8914fef1b
commit af625cb63d

@ -710,6 +710,18 @@ define([
var el = e.currentTarget; var el = e.currentTarget;
if (!el || el.nodeName !== 'A') { return; } if (!el || el.nodeName !== 'A') { return; }
var href = el.getAttribute('href'); var href = el.getAttribute('href');
if (/^#/.test(href)) {
try {
$inner.find('.cke_anchor[data-cke-realelement]').each(function (i, el) {
var i = editor.restoreRealElement($(el));
var node = i.$;
if (node.id === href.slice(1)) {
el.scrollIntoView();
}
});
} catch (e) {}
return;
}
if (href) { if (href) {
framework._.sfCommon.openUnsafeURL(href); framework._.sfCommon.openUnsafeURL(href);
} }

Loading…
Cancel
Save