From c64d404c22378d22589074119b1ad3c7d8fc326d Mon Sep 17 00:00:00 2001 From: Renze Yu Date: Mon, 23 Jan 2017 16:47:01 +0800 Subject: [PATCH 1/2] fix footer cover sidetoc --- src/docfx.website.themes/default/styles/docfx.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/docfx.website.themes/default/styles/docfx.js b/src/docfx.website.themes/default/styles/docfx.js index cb35de0b413..139acb7d057 100644 --- a/src/docfx.website.themes/default/styles/docfx.js +++ b/src/docfx.website.themes/default/styles/docfx.js @@ -349,6 +349,9 @@ $(function () { var tocPath = $("meta[property='docfx\\:tocrel']").attr("content"); if (tocPath) tocPath = tocPath.replace(/\\/g, '/'); $('#sidetoc').load(tocPath + " #sidetoggle > div", function () { + if ($('footer').is(':visible')) { + $(".sidetoc").css("bottom", "70px"); + } registerTocEvents(); var index = tocPath.lastIndexOf('/'); From 2152c77fe6f63f8f12c8e544aff2dd1557af92fe Mon Sep 17 00:00:00 2001 From: Renze Yu Date: Thu, 26 Jan 2017 13:20:10 +0800 Subject: [PATCH 2/2] use class for style --- src/docfx.website.themes/default/styles/docfx.css | 7 +++++++ src/docfx.website.themes/default/styles/docfx.js | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/docfx.website.themes/default/styles/docfx.css b/src/docfx.website.themes/default/styles/docfx.css index 74af8092516..996b9eb7c36 100644 --- a/src/docfx.website.themes/default/styles/docfx.css +++ b/src/docfx.website.themes/default/styles/docfx.css @@ -421,6 +421,10 @@ article section { z-index: 1; } +.sidetoc.shiftup { + bottom: 70px; +} + body .toc{ background-color: #f1f1f1; overflow-x: hidden; @@ -583,6 +587,9 @@ body .toc{ bottom: 10px; position: fixed; } +.sideaffix.shiftup { + bottom: 70px; +} .affix { position: relative; height: 100%; diff --git a/src/docfx.website.themes/default/styles/docfx.js b/src/docfx.website.themes/default/styles/docfx.js index 139acb7d057..089116d6f5a 100644 --- a/src/docfx.website.themes/default/styles/docfx.js +++ b/src/docfx.website.themes/default/styles/docfx.js @@ -350,7 +350,7 @@ $(function () { if (tocPath) tocPath = tocPath.replace(/\\/g, '/'); $('#sidetoc').load(tocPath + " #sidetoggle > div", function () { if ($('footer').is(':visible')) { - $(".sidetoc").css("bottom", "70px"); + $('.sidetoc').addClass('shiftup'); } registerTocEvents(); @@ -397,7 +397,7 @@ $(function () { // 50 is the size of the filter box $('.sidetoc').scrollTop(top - 50); if ($('footer').is(':visible')) { - $(".sidetoc").css("bottom", "70px"); + $('.sidetoc').addClass('shiftup'); } } else { $(e).parent().removeClass(active); @@ -675,13 +675,13 @@ $(function () { } function resetBottomCss() { - $(".sidetoc").css("bottom", "0"); - $(".sideaffix").css("bottom", "10px"); + $(".sidetoc").removeClass("shiftup"); + $(".sideaffix").removeClass("shiftup"); } function shiftUpBottomCss() { - $(".sidetoc").css("bottom", "70px"); - $(".sideaffix").css("bottom", "70px"); + $(".sidetoc").addClass("shiftup"); + $(".sideaffix").addClass("shiftup"); } })();