fix docs.js bug where changeApiLevel is getting called

Change-Id: Ic250afc792d7e4174bd987ce31df384dad3831ca
diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js
index 59ddb29..1cf68b3 100644
--- a/tools/droiddoc/templates-sdk/assets/js/docs.js
+++ b/tools/droiddoc/templates-sdk/assets/js/docs.js
@@ -1848,15 +1848,16 @@
 /* ######################################################## */
 
 /* Initialize some droiddoc stuff, but only if we're in the reference */
-if ((location.pathname.indexOf("/reference") &&
-  !location.pathname.indexOf("/reference-gms/packages.html") &&
-  !location.pathname.indexOf("/reference-gcm/packages.html") &&
-  !location.pathname.indexOf("/reference/com/google")) == 0) {
-  $(document).ready(function() {
-    // init available apis based on user pref
-    changeApiLevel();
-    initSidenavHeightResize()
-  });
+if (location.pathname.indexOf("/reference")) {
+  if(!location.pathname.indexOf("/reference-gms/packages.html")
+    && !location.pathname.indexOf("/reference-gcm/packages.html")
+    && !location.pathname.indexOf("/reference/com/google") == 0) {
+    $(document).ready(function() {
+      // init available apis based on user pref
+      changeApiLevel();
+      initSidenavHeightResize()
+      });
+  }
 }
 
 var API_LEVEL_COOKIE = "api_level";