Fix scrollToLinkedComment()
The test was done against location.hash, which contains a hash symbol. Strip it for the test.
This commit is contained in:
@@ -100,12 +100,13 @@ script.
|
|||||||
var scrollToId = location.hash;
|
var scrollToId = location.hash;
|
||||||
|
|
||||||
// Check that it's a valid ObjectID before passing it to jQuery.
|
// 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)
|
$(scrollToId)
|
||||||
.addClass('comment-linked')
|
.addClass('comment-linked')
|
||||||
.scrollHere();
|
.scrollHere();
|
||||||
}
|
}
|
||||||
|
|
||||||
$(scrollToLinkedComment);
|
$(scrollToLinkedComment);
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Reference in New Issue
Block a user