Loading tools/droiddoc/templates-sdk/assets/js/docs.js +5 −5 Original line number Original line Diff line number Diff line Loading @@ -2538,14 +2538,14 @@ google.setOnLoadCallback(function(){ /* Adjust the scroll position to account for sticky header, only if the hash matches an id */ /* Adjust the scroll position to account for sticky header, only if the hash matches an id */ function offsetScrollForSticky() { function offsetScrollForSticky() { var hash = location.hash; var hash = escape(location.hash.substr(1)); var $matchingElement = $(hash); var $matchingElement = $("#"+hash); // If there's no element with the hash as an ID, then look for an <a name=''> with it. // If there's no element with the hash as an ID, then look for an <a name=''> with it. if ($matchingElement.length < 1) { if ($matchingElement.length < 1) { $matchingElement = $('a[name="' + hash.substr(1) + '"]'); $matchingElement = $('a[name="' + hash + '"]'); } } // Sanity check that hash is a real hash and that there's an element with that ID on the page // Sanity check that there's an element with that ID on the page if ((hash.indexOf("#") == 0) && $matchingElement.length) { if ($matchingElement.length) { // If the position of the target element is near the top of the page (<20px, where we expect it // If the position of the target element is near the top of the page (<20px, where we expect it // to be because we need to move it down 60px to become in view), then move it down 60px // to be because we need to move it down 60px to become in view), then move it down 60px if (Math.abs($matchingElement.offset().top - $(window).scrollTop()) < 20) { if (Math.abs($matchingElement.offset().top - $(window).scrollTop()) < 20) { Loading Loading
tools/droiddoc/templates-sdk/assets/js/docs.js +5 −5 Original line number Original line Diff line number Diff line Loading @@ -2538,14 +2538,14 @@ google.setOnLoadCallback(function(){ /* Adjust the scroll position to account for sticky header, only if the hash matches an id */ /* Adjust the scroll position to account for sticky header, only if the hash matches an id */ function offsetScrollForSticky() { function offsetScrollForSticky() { var hash = location.hash; var hash = escape(location.hash.substr(1)); var $matchingElement = $(hash); var $matchingElement = $("#"+hash); // If there's no element with the hash as an ID, then look for an <a name=''> with it. // If there's no element with the hash as an ID, then look for an <a name=''> with it. if ($matchingElement.length < 1) { if ($matchingElement.length < 1) { $matchingElement = $('a[name="' + hash.substr(1) + '"]'); $matchingElement = $('a[name="' + hash + '"]'); } } // Sanity check that hash is a real hash and that there's an element with that ID on the page // Sanity check that there's an element with that ID on the page if ((hash.indexOf("#") == 0) && $matchingElement.length) { if ($matchingElement.length) { // If the position of the target element is near the top of the page (<20px, where we expect it // If the position of the target element is near the top of the page (<20px, where we expect it // to be because we need to move it down 60px to become in view), then move it down 60px // to be because we need to move it down 60px to become in view), then move it down 60px if (Math.abs($matchingElement.offset().top - $(window).scrollTop()) < 20) { if (Math.abs($matchingElement.offset().top - $(window).scrollTop()) < 20) { Loading