Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/progrhyme/hugo-theme-bootie-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYASUTAKE Kiyoshi <quee.amb@gmail.com>2016-05-06 07:15:37 +0300
committerYASUTAKE Kiyoshi <quee.amb@gmail.com>2016-05-06 07:15:37 +0300
commitd52ad0103ec9eaaf71c104583b608e571ce47f80 (patch)
treea02aa838c1509ca6983bdf6f9a6d6da31b74c73c
parentc1b546357659cc27a65bcca192855781266e00db (diff)
parentfaef4a7e80493ae20a6c6d37f83ddf9c85c9bf3e (diff)
Merge pull request #13 from key-amb/maint
Fix #11, #12
-rw-r--r--layouts/partials/footer.html2
-rw-r--r--static/css/bootie-docs.css1
-rw-r--r--static/js/bootie-docs.js16
3 files changed, 14 insertions, 5 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index a1e5f67..b2dedaa 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -3,7 +3,7 @@
<div class="row">
<div class="col-sm-8">
- <p class="doc-footer-em"><a href="#">Back to TOP</a></p>
+ <p class="doc-footer-em"><a href="#" onclick="resetSidebarPos()">Back to TOP</a></p>
</div>
</div>
diff --git a/static/css/bootie-docs.css b/static/css/bootie-docs.css
index f41c9e6..a518d24 100644
--- a/static/css/bootie-docs.css
+++ b/static/css/bootie-docs.css
@@ -190,7 +190,6 @@ main > article > section > table > tbody > tr:nth-of-type(odd) {
*/
div#sidebar {
- position: fixed;
}
/* Sidebar modules for boxing content */
diff --git a/static/js/bootie-docs.js b/static/js/bootie-docs.js
index 6dc000b..22ede36 100644
--- a/static/js/bootie-docs.js
+++ b/static/js/bootie-docs.js
@@ -6,9 +6,12 @@ window.onload = function() {
var totalHeight = headHeight + mainHeight + footHeight;
var w = $(window);
- if (sideHeight > 0 && sideHeight < mainHeight) {
+ if ( w.width() > $("main").width() + $("#sidebar").width()
+ && sideHeight > 0
+ && sideHeight < mainHeight ) {
$(".doc-sidebar").css("height", mainHeight);
var sideNode = $("#sidebar");
+ sideNode.css({"position": "fixed"});
var scrollStart = 0;
var scrollStop = headHeight + mainHeight - sideHeight;
@@ -16,7 +19,7 @@ window.onload = function() {
if (w.scrollTop() <= scrollStart) {
sideNode.css({"position": "fixed"});
} else if (scrollStart < w.scrollTop() && w.scrollTop() < scrollStop) {
- sideNode.css({"position": "fixed", "top": headHeight + "px"});
+ sideNode.css({"position": "fixed", "top": headHeight + 20 + "px"});
} else if (w.scrollTop() >= scrollStop) {
var topNext
= headHeight - (headHeight + sideHeight)
@@ -26,5 +29,12 @@ window.onload = function() {
});
}
});
- }
+ }
+}
+
+function resetSidebarPos() {
+ var sideNode = $("#sidebar");
+ if ( $(window).width() > $("main").width() + $("#sidebar").width() ) {
+ sideNode.css({"position": "fixed", "top": "", "bottom": ""});
+ }
} \ No newline at end of file