WebHelp: additional checks and escaping for identifiers from url anchor hashes. #PL-2618 fixed

This commit is contained in:
Dmitry Kozlov 2013-09-16 14:58:22 +00:00
parent 87661d8f0b
commit 5fa5d24bbc

View File

@ -81,10 +81,15 @@ $(document).ready(function() {
// you click on a link from another page.
var hash = window.location.hash;
if(hash){
var targetOffset = $(hash).offset().top - 120;
$('html,body').animate({scrollTop: targetOffset}, 200);
return false;
// Also escape dot symbols.
hash = hash.split('.').join('\\.');
$hash = $(hash);
if ($hash.length) {
var offset = $hash.offset().top - 120;
$('html,body').animate({scrollTop: offset}, 200);
}
}
return false;
});