From 01a2545bbab916e45eedbd3708f526ed8bd62935 Mon Sep 17 00:00:00 2001 From: Scott Main Date: Tue, 12 Feb 2013 17:32:27 -0800 Subject: [PATCH] docs: update templates to remove global content for devsite builds Change-Id: I8c8d052248cebe6408d8c18b44baadd03f3bc96c --- .../droiddoc/templates-sdk/assets/js/docs.js | 6 ++++-- .../templates-sdk/components/masthead.cs | 18 +++++++++-------- tools/droiddoc/templates-sdk/docpage.cs | 1 - tools/droiddoc/templates-sdk/head_tag.cs | 20 ++++++++++++++----- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js index eec97b25b4..3d34352043 100644 --- a/tools/droiddoc/templates-sdk/assets/js/docs.js +++ b/tools/droiddoc/templates-sdk/assets/js/docs.js @@ -142,6 +142,9 @@ $(document).ready(function() { } } + // Need a copy of the pagePath before it gets changed in the next block; + // it's needed to perform proper tab highlighting in offline docs (see rootDir below) + var pagePathOriginal = pagePath; if (SITE_ROOT.match(/\.\.\//) || SITE_ROOT == '') { // If running locally, SITE_ROOT will be a relative path, so account for that by // finding the relative URL to this page. This will allow us to find links on the page @@ -169,9 +172,8 @@ $(document).ready(function() { // highlight Develop tab } else if ($("body").hasClass("develop") || $("body").hasClass("google")) { $("#header li.develop a").addClass("selected"); - // In Develop docs, also highlight appropriate sub-tab - var rootDir = pagePath.substring(1,pagePath.indexOf('/', 1)); + var rootDir = pagePathOriginal.substring(1,pagePathOriginal.indexOf('/', 1)); if (rootDir == "training") { $("#nav-x li.training a").addClass("selected"); } else if (rootDir == "guide") { diff --git a/tools/droiddoc/templates-sdk/components/masthead.cs b/tools/droiddoc/templates-sdk/components/masthead.cs index 9f19906924..ba1d382dcc 100644 --- a/tools/droiddoc/templates-sdk/components/masthead.cs +++ b/tools/droiddoc/templates-sdk/components/masthead.cs @@ -1,4 +1,6 @@ + +