diff --git a/layout/tags.ejs b/layout/tags.ejs index 68592ad..ae9f6c5 100644 --- a/layout/tags.ejs +++ b/layout/tags.ejs @@ -4,20 +4,16 @@ - + \ No newline at end of file diff --git a/source/css/style.styl b/source/css/style.styl index a7a57bb..d6c8554 100644 --- a/source/css/style.styl +++ b/source/css/style.styl @@ -49,6 +49,10 @@ body, button, input, select, textarea &.is-sticky top: 1.5rem +.tag + &.is-grey + background: #e7e7e7 + .card border-radius: 4px box-shadow: 0 4px 10px rgba(0,0,0,0.05), 0 0 1px rgba(0,0,0,0.1) diff --git a/source/js/back-to-top.js b/source/js/back-to-top.js index 11d2b3f..8cf8cc4 100644 --- a/source/js/back-to-top.js +++ b/source/js/back-to-top.js @@ -93,6 +93,10 @@ $(document).ready(function () { })); } + function getScrollTop() { + return $(window).scrollTop(); + } + function getScrollBottom() { return $(window).scrollTop() + $(window).height(); } @@ -116,7 +120,7 @@ $(document).ready(function () { var padding = ($mainColumn.outerWidth() - $mainColumn.width()) / 2; var maxLeft = $(window).width() - getButtonWidth() - rightMargin; var maxBottom = $footer.offset().top + getButtonHeight() / 2 + bottomMargin; - if (getScrollBottom() < getRightSidebarBottom() + padding + getButtonHeight()) { + if (getScrollTop() == 0 || getScrollBottom() < getRightSidebarBottom() + padding + getButtonHeight()) { nextState = state['desktop-hidden']; } else if (getScrollBottom() < maxBottom) { nextState = state['desktop-visible'];