am f0daf562: Merge "fix bug causing anchors to fail on preview landing page; exit the onhashchange listener if there\'s no searchbar on the page" into lmp-dev

* commit 'f0daf562f766d1cf15583e171b94107c193e5db4':
  fix bug causing anchors to fail on preview landing page; exit the onhashchange listener if there's no searchbar on the page
diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js
index 2824a3d..3d278c3 100644
--- a/tools/droiddoc/templates-sdk/assets/js/docs.js
+++ b/tools/droiddoc/templates-sdk/assets/js/docs.js
@@ -2552,6 +2552,9 @@
 
 // when an event on the browser history occurs (back, forward, load) requery hash and do search
 $(window).hashchange( function(){
+  // Ignore if there's no search bar (some special pages have no header)
+  if ($("#search-container").length < 1) return;
+
   // If the hash isn't a search query or there's an error in the query,
   // then adjust the scroll position to account for sticky header, then exit.
   if ((location.hash.indexOf("q=") == -1) || (query == "undefined")) {