diff options
Diffstat (limited to 'public/views/html.hbs')
-rw-r--r-- | public/views/html.hbs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/public/views/html.hbs b/public/views/html.hbs index 5ef51920..a300ddd5 100644 --- a/public/views/html.hbs +++ b/public/views/html.hbs @@ -160,6 +160,29 @@ removeHash(); }); + var toggle = $('.expand-toggle'); + var tocExpand = false; + + checkExpandToggle(); + toggle.click(function (e) { + e.preventDefault(); + e.stopPropagation(); + tocExpand = !tocExpand; + checkExpandToggle(); + }) + + function checkExpandToggle () { + var toc = $('.ui-toc-dropdown .toc'); + var toggle = $('.expand-toggle'); + if (!tocExpand) { + toc.removeClass('expand'); + toggle.text('Expand all'); + } else { + toc.addClass('expand'); + toggle.text('Collapse all'); + } + } + function scrollToTop() { $('body, html').stop(true, true).animate({ scrollTop: 0 |