Fixed toc might not have proper view in some cases
This commit is contained in:
parent
fb8ead594a
commit
e0ff287652
1 changed files with 5 additions and 1 deletions
|
@ -536,13 +536,17 @@ function checkTocStyle() {
|
||||||
var affixLeftMargin = (ui.toc.affix.outerWidth() - ui.toc.affix.width()) / 2;
|
var affixLeftMargin = (ui.toc.affix.outerWidth() - ui.toc.affix.width()) / 2;
|
||||||
var left = ui.area.markdown.offset().left + ui.area.markdown.outerWidth() - affixLeftMargin;
|
var left = ui.area.markdown.offset().left + ui.area.markdown.outerWidth() - affixLeftMargin;
|
||||||
ui.toc.affix.css('left', left + 'px');
|
ui.toc.affix.css('left', left + 'px');
|
||||||
|
ui.toc.affix.css('width', rightMargin + 'px');
|
||||||
} else {
|
} else {
|
||||||
newbool = false;
|
newbool = false;
|
||||||
}
|
}
|
||||||
//toc scrollspy
|
//toc scrollspy
|
||||||
ui.toc.toc.removeClass('scrollspy-body, scrollspy-view');
|
ui.toc.toc.removeClass('scrollspy-body, scrollspy-view');
|
||||||
ui.toc.affix.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.toc.addClass('scrollspy-body');
|
||||||
ui.toc.affix.addClass('scrollspy-body');
|
ui.toc.affix.addClass('scrollspy-body');
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue