summaryrefslogtreecommitdiff
path: root/public/js/extra.js
diff options
context:
space:
mode:
authorWu Cheng-Han2016-08-14 11:24:04 +0800
committerWu Cheng-Han2016-08-14 11:24:04 +0800
commite08152ed03639cfa0592678840b4b8d0b98aa19b (patch)
tree8dbad74db494161cc2b88201e5396ac6af21c692 /public/js/extra.js
parent8d24d9e97fe362f6cfd63da32ec4f4bd07b5bd9a (diff)
Update toc styles to make toc menu always accessible without scrolling
Diffstat (limited to 'public/js/extra.js')
-rw-r--r--public/js/extra.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/public/js/extra.js b/public/js/extra.js
index 40496967..824b78d1 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -595,6 +595,7 @@ function generateToc(id) {
});
if (target.text() == 'undefined')
target.html('');
+ var tocMenu = $('<div class="toc-menu"></div');
var toggle = $('<a class="expand-toggle" href="#">Expand all</a>');
var backtotop = $('<a class="back-to-top" href="#">Back to top</a>');
var gotobottom = $('<a class="go-to-bottom" href="#">Go to bottom</a>');
@@ -619,7 +620,8 @@ function generateToc(id) {
scrollToBottom();
removeHash();
});
- target.append(toggle).append(backtotop).append(gotobottom);
+ tocMenu.append(toggle).append(backtotop).append(gotobottom);
+ target.append(tocMenu);
}
//smooth all hash trigger scrolling