js: offsetScroll to elements that are found

This commit is contained in:
Marcin Lulek 2016-09-14 15:23:09 +02:00
parent 3469c46507
commit 8d9db09b41
3 changed files with 9 additions and 3 deletions

View file

@ -375,7 +375,9 @@
if (location.hash) {
var result = splitDelimitedHash(location.hash);
var line = $('html').find(result.loc);
offsetScroll(line, 70);
if (line.length > 0){
offsetScroll(line, 70);
}
}
// browse tree @ revision

View file

@ -177,7 +177,9 @@
var _first_line = $('#L' + h_lines[0]).get(0);
if (_first_line) {
var line = $('#L' + h_lines[0]);
offsetScroll(line, 70);
if (line.length > 0){
offsetScroll(line, 70);
}
}
}
}

View file

@ -415,7 +415,9 @@
if (location.hash) {
var result = splitDelimitedHash(location.hash);
var line = $('html').find(result.loc);
offsetScroll(line, 70);
if (line.length > 0){
offsetScroll(line, 70);
}
}
$(function(){
ReviewerAutoComplete('user');