am 7f37fba6: am 19c6780f: Merge "fix scroll offset when loading non-header pages" into lmp-dev
* commit '7f37fba64573c6b6d755e1a3c36422555feb6ff2':
fix scroll offset when loading non-header pages
diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js
index 3d278c3..a556f4f 100644
--- a/tools/droiddoc/templates-sdk/assets/js/docs.js
+++ b/tools/droiddoc/templates-sdk/assets/js/docs.js
@@ -2538,6 +2538,9 @@
/* Adjust the scroll position to account for sticky header, only if the hash matches an id.
This does not handle <a name=""> tags. Some CSS fixes those, but only for reference docs. */
function offsetScrollForSticky() {
+ // Ignore if there's no search bar (some special pages have no header)
+ if ($("#search-container").length < 1) return;
+
var hash = escape(location.hash.substr(1));
var $matchingElement = $("#"+hash);
// Sanity check that there's an element with that ID on the page