From b743a158ffa29c71b14552daf69189b8e9e7529b Mon Sep 17 00:00:00 2001 From: David Cramer Date: Tue, 6 Jul 2010 19:06:13 +0000 Subject: [PATCH] Fixing bug where current topic in toc wasn't highlighted but title was. --- xsl/webhelp/template/common/main.js | 12 ++++++++---- xsl/webhelp/xsl/webhelp.xsl | 27 +++++++++++++++++++-------- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/xsl/webhelp/template/common/main.js b/xsl/webhelp/template/common/main.js index 1eebbfe8b..0dc61a0d4 100755 --- a/xsl/webhelp/template/common/main.js +++ b/xsl/webhelp/template/common/main.js @@ -64,16 +64,20 @@ function searchTabClick(e) { * @param id the node/element id which should be displayed when synching. */ function syncToc(id){ - var a = document.getElementById(id); + var a = document.getElementById("webhelp-currentid"); + var b = a.getElementsByTagName("a")[0]; //Setting the background for selected node. var style = a.getAttribute("style"); if(style != null && !style.match(/background-color: Background;/)){ - a.setAttribute("style", "background-color: Background; "+style); + a.setAttribute("style", "background-color: Background; "+style); + b.setAttribute("style", "color: white;"); } else if(style != null){ - a.setAttribute("style", "background-color: Background; " + style); + a.setAttribute("style", "background-color: Background; " + style); + b.setAttribute("style", "color: white;"); } else { - a.setAttribute("style", "background-color: Background; "); + a.setAttribute("style", "background-color: Background; "); + b.setAttribute("style", "color: white;"); } while (a.parentNode && a.parentNode.nodeName){ diff --git a/xsl/webhelp/xsl/webhelp.xsl b/xsl/webhelp/xsl/webhelp.xsl index e50784861..8501e8aab 100755 --- a/xsl/webhelp/xsl/webhelp.xsl +++ b/xsl/webhelp/xsl/webhelp.xsl @@ -5,10 +5,10 @@ version="1.0" xmlns="http://www.w3.org/1999/xhtml"> - + href="c:/gsoc2010/docbook-xsl-1.75.2/xhtml/chunk.xsl"/> + @@ -150,7 +150,9 @@ - + + + @@ -312,7 +314,7 @@ - + @@ -344,6 +346,7 @@ + @@ -429,7 +432,9 @@ loading table of contents... @@ -470,6 +475,7 @@ + @@ -500,7 +506,10 @@ -
  • +
  • + + webhelp-currentid + @@ -510,7 +519,9 @@
      + mode="webhelptoc"> + +
  • -- 2.40.0