From: Mike Cardwell Date: Mon, 19 Jul 2010 19:07:47 +0000 (+0800) Subject: Collapse TOC if anywhere on the page is clicked X-Git-Tag: exim-4_89_1~99 X-Git-Url: https://git.exim.org/exim-website.git/commitdiff_plain/48f19d7cac8d071c5165bde649945add1d011d95 Collapse TOC if anywhere on the page is clicked --- diff --git a/templates/web/doc/chapter.js b/templates/web/doc/chapter.js index 47c2460..1e81a84 100644 --- a/templates/web/doc/chapter.js +++ b/templates/web/doc/chapter.js @@ -2,6 +2,7 @@ (function ($) { var click_func = function (e) { + e.stopPropagation(); if ($('#toc').data('opened')) { $('#toc > *').animate({ left: '-=' + $('#toc > ul').width() + 'px' @@ -15,6 +16,10 @@ } }; + $('body').click(function () { + if( $('#toc').data('opened') ) $('#toc > img').mousedown(); + }); + var type = document.location.pathname.match(/\/doc\/html\/spec_html\/filter/) ? 'filter' : 'spec'; // Get the relevant table of contents @@ -47,4 +52,4 @@ }); }); }); -})(jQuery); \ No newline at end of file +})(jQuery);