summaryrefslogtreecommitdiff
path: root/public/views/html.hbs
diff options
context:
space:
mode:
authorMax Wu2017-05-14 17:42:14 +0800
committerGitHub2017-05-14 17:42:14 +0800
commitc37b6669158750ab2222e81a5a8fc3a5c8c353f5 (patch)
tree8e96eb37c1715f860a698d5e7eeb2381b00af9d8 /public/views/html.hbs
parent0c619fee91ac5b7dbacf60244c9f6fec6ed62ba7 (diff)
parentf85d1d880114b6787fdb2bac488341776deaad3d (diff)
Merge branch 'master' into BackendRefactor
Diffstat (limited to '')
-rw-r--r--public/views/html.hbs23
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