embed: do not jump to unrelated anchor on load

When loading, Isso scrolls to the current document hash. This makes
sense when the document hash references a comment, but this doesn't
for an unrelated anchor. Tell Isso to only scroll for a comment.
master
Vincent Bernat 6 years ago
parent f6271a04a2
commit 463f76cb0b

@ -71,7 +71,8 @@ require(["app/lib/ready", "app/config", "app/i18n", "app/api", "app/isso", "app/
isso.insert_loader(rv, lastcreated);
}
if (window.location.hash.length > 0) {
if (window.location.hash.length > 0 &&
window.location.hash.match("^#isso-[0-9]+$")) {
$(window.location.hash).scrollIntoView();
}
},

Loading…
Cancel
Save