From 08f336eaffa09581f2c33aee99847ee4edbeb370 Mon Sep 17 00:00:00 2001 From: "smain@google.com" Date: Fri, 3 Oct 2014 17:40:00 -0700 Subject: [PATCH] fix regression from Change-Id: I88c1e8192f1cbb5373af592b9e9f9a04ffe6fc7c that causes anchors in most docs other than reference to stop working Change-Id: I58ed0f7a84c4478d482d63e675693a197088019a --- tools/droiddoc/templates-sdk/assets/js/docs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js index a9887d0e4..2824a3d22 100644 --- a/tools/droiddoc/templates-sdk/assets/js/docs.js +++ b/tools/droiddoc/templates-sdk/assets/js/docs.js @@ -2540,8 +2540,8 @@ google.setOnLoadCallback(function(){ function offsetScrollForSticky() { var hash = escape(location.hash.substr(1)); var $matchingElement = $("#"+hash); - // Sanity check that hash is a real hash and that there's an element with that ID on the page - if ((hash.indexOf("#") == 0) && $matchingElement.length) { + // Sanity check that there's an element with that ID on the page + if ($matchingElement.length) { // 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 if (Math.abs($matchingElement.offset().top - $(window).scrollTop()) < 20) { -- 2.11.0