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;
 | 
			
		||||
 | 
			
		||||
		// 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 %}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user