From af625cb63de7f930c9d17e9298ae4d41c8dc6df8 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 12 Apr 2021 15:55:49 +0200 Subject: [PATCH] Fix anchors in rich text readonly --- www/pad/inner.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/www/pad/inner.js b/www/pad/inner.js index 793d57b72..96f27c36a 100644 --- a/www/pad/inner.js +++ b/www/pad/inner.js @@ -710,6 +710,18 @@ define([ var el = e.currentTarget; if (!el || el.nodeName !== 'A') { return; } 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) { framework._.sfCommon.openUnsafeURL(href); }