#1226: lint compliance and optimization

This commit is contained in:
Fabrice Mouhartem 2024-01-25 15:17:29 +01:00
parent f5bd81bbb0
commit b51f1878c3

View File

@ -27,6 +27,7 @@ define([
try {
var foundAnchor = false;
$inner.find('.cke_anchor[data-cke-realelement]').each(function (j, el) {
if (foundAnchor) { return; }
var i = editor.restoreRealElement($(el));
var node = i.$;
if (node.id === href.slice(1)) {
@ -36,7 +37,7 @@ define([
});
if (!foundAnchor) {
var anchorsById = $inner.find('#' + href.slice(1));
if (anchorsById.length != 0) { anchorsById[0].scrollIntoView(); }
if (anchorsById.length) { anchorsById[0].scrollIntoView(); }
}
} catch (err) {}
return;