# HG changeset patch # User Marcin Lulek # Date 2016-09-14 13:23:09 # Node ID 6ce205ffa391e81820a63b68d61608e939ca38a5 # Parent fc8d20692521baa085f9dad75d7dcc65343266fe js: offsetScroll to elements that are found diff --git a/rhodecode/templates/changeset/changeset.html b/rhodecode/templates/changeset/changeset.html --- a/rhodecode/templates/changeset/changeset.html +++ b/rhodecode/templates/changeset/changeset.html @@ -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 diff --git a/rhodecode/templates/files/files.html b/rhodecode/templates/files/files.html --- a/rhodecode/templates/files/files.html +++ b/rhodecode/templates/files/files.html @@ -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); + } } } } diff --git a/rhodecode/templates/pullrequests/pullrequest_show.html b/rhodecode/templates/pullrequests/pullrequest_show.html --- a/rhodecode/templates/pullrequests/pullrequest_show.html +++ b/rhodecode/templates/pullrequests/pullrequest_show.html @@ -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');