Fix scrollToLinkedComment()
The test was done against location.hash, which contains a hash symbol. Strip it for the test.
This commit is contained in:
parent
df6297d40f
commit
7292c534ed
@ -100,12 +100,13 @@ script.
|
||||
var scrollToId = location.hash;
|
||||
|
||||
// Check that it's a valid ObjectID before passing it to jQuery.
|
||||
if (!/^[a-fA-F0-9]{24}$/.test(scrollToId)) return;
|
||||
if (!/^[a-fA-F0-9]{24}$/.test(scrollToId.replace('#',''))) return;
|
||||
|
||||
$(scrollToId)
|
||||
.addClass('comment-linked')
|
||||
.scrollHere();
|
||||
}
|
||||
|
||||
$(scrollToLinkedComment);
|
||||
|
||||
{% endif %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user