mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 20:28:00 +08:00
WebHelp: additional checks and escaping for identifiers from url anchor hashes. #PL-2618 fixed
This commit is contained in:
parent
87661d8f0b
commit
5fa5d24bbc
@ -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;
|
||||
});
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user