]> granicus.if.org Git - docbook-dsssl/commitdiff
Implement toc.hide.show in a cross-platform manner
authorNorman Walsh <ndw@nwalsh.com>
Wed, 29 May 2002 18:50:52 +0000 (18:50 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Wed, 29 May 2002 18:50:52 +0000 (18:50 +0000)
slides/browser/slides.js
slides/xsl/slides.xsl

index 89b706fae6f32aeaca46b82e35a9e29690607c87..b946c56dc29bd35a57758f6878c97c4ac8e63767 100644 (file)
@@ -68,3 +68,20 @@ function navigate (evt) {
        window.location = target;
     }
 }
+
+function toggletoc (img, width, hidegraphic, showgraphic) {
+    var fsc = xbGetElementsByName('FRAMESET',top);
+    if (fsc) {
+       var fs = fsc[0];
+       if (fs) {
+           if (fs.cols == "0,*") {
+               fs.cols = width + ",*";
+               img.src = hidegraphic;
+           } else {
+               fs.cols = "0,*";
+               img.src = showgraphic;
+           }
+       }
+    }
+}
+
index d0d39dfb0d4469d7ce69a1eceaf47d17d133b526..9348835afc0d89d98d7222c7073a9e5551dbca61 100644 (file)
           <xsl:call-template name="hidetoc.image"/>
        </xsl:attribute>
        <xsl:attribute name="onClick">
-if (parent.parent.document.all.topframe.cols=="0,*") {
-   parent.parent.document.all.topframe.cols="<xsl:value-of select="$toc.width"/>,*";
-   this.src = "<xsl:call-template name="hidetoc.image"/>";
-} else {
-   parent.parent.document.all.topframe.cols="0,*";
-   this.src = "<xsl:call-template name="showtoc.image"/>";
-};
-       </xsl:attribute>
+          <xsl:text>toggletoc(this,</xsl:text>
+          <xsl:value-of select="$toc.width"/>
+          <xsl:text>,'</xsl:text>
+          <xsl:call-template name="hidetoc.image"/>
+          <xsl:text>','</xsl:text>
+          <xsl:call-template name="showtoc.image"/>
+          <xsl:text>');</xsl:text>
+        </xsl:attribute>
       </img>
     </td>
   </xsl:if>