summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Cheng-Han2015-09-25 18:32:33 +0800
committerWu Cheng-Han2015-09-25 18:32:33 +0800
commite0ff2876525099c2a39c494985641b7ea35b5c8a (patch)
tree60ca8ad7d077d8c5a571697dcb7a8ff49e3259b3
parentfb8ead594a06e84db9dcf214742aa9a0951608b5 (diff)
Fixed toc might not have proper view in some cases
-rw-r--r--public/js/index.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 62d17600..6b269d10 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -536,13 +536,17 @@ function checkTocStyle() {
var affixLeftMargin = (ui.toc.affix.outerWidth() - ui.toc.affix.width()) / 2;
var left = ui.area.markdown.offset().left + ui.area.markdown.outerWidth() - affixLeftMargin;
ui.toc.affix.css('left', left + 'px');
+ ui.toc.affix.css('width', rightMargin + 'px');
} else {
newbool = false;
}
//toc scrollspy
ui.toc.toc.removeClass('scrollspy-body, scrollspy-view');
ui.toc.affix.removeClass('scrollspy-body, scrollspy-view');
- if (currentMode != modeType.both && !newbool) {
+ if (currentMode == modeType.both) {
+ ui.toc.toc.addClass('scrollspy-view');
+ ui.toc.affix.addClass('scrollspy-view');
+ } else if (currentMode != modeType.both && !newbool) {
ui.toc.toc.addClass('scrollspy-body');
ui.toc.affix.addClass('scrollspy-body');
} else {