patch: hide ToC title if ToC empty

View: New views
2 Messages — Rating Filter:   Alert me  

patch: hide ToC title if ToC empty

by Alex Efros-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

--- /etc/asciidoc/javascripts/toc.js    2008-04-11 05:00:40.000000000 +0300
+++ toc.js      2008-04-21 22:22:33.000000000 +0300
@@ -64,4 +64,6 @@
     div.className = "toclevel" + entry.toclevel;
     toc.appendChild(div);
   }
+  if (entries.length == 0)
+    document.getElementById("header").removeChild(toc);
 }

--
                        WBR, Alex.
_______________________________________________
asciidoc-discuss mailing list
asciidoc-discuss@...
http://lists.metaperl.com/cgi-bin/mailman/listinfo/asciidoc-discuss

Re: patch: hide ToC title if ToC empty

by Stuart Rackham :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the patch Alex, see changeset
http://hg.sharesource.org/asciidoc/rev/c66b42f5aa59

Cheers, Stuart

Alex Efros wrote:

> Hi!
>
> --- /etc/asciidoc/javascripts/toc.js    2008-04-11 05:00:40.000000000 +0300
> +++ toc.js      2008-04-21 22:22:33.000000000 +0300
> @@ -64,4 +64,6 @@
>      div.className = "toclevel" + entry.toclevel;
>      toc.appendChild(div);
>    }
> +  if (entries.length == 0)
> +    document.getElementById("header").removeChild(toc);
>  }
>
_______________________________________________
asciidoc-discuss mailing list
asciidoc-discuss@...
http://lists.metaperl.com/cgi-bin/mailman/listinfo/asciidoc-discuss