From 7d600170a38c7fe3a148ab655bc57de3a9fa624e Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Thu, 25 Dec 2014 19:45:11 +0500 Subject: [PATCH] [#369] fix scroller --- .../javascripts/extra/scroller.js.coffee | 25 +++++++++++-------- .../stylesheets/custom_bootstrap.css.sass | 2 +- app/views/layouts/_scroller.html.slim | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/app/assets/javascripts/extra/scroller.js.coffee b/app/assets/javascripts/extra/scroller.js.coffee index 9e63006f1..75d733154 100644 --- a/app/assets/javascripts/extra/scroller.js.coffee +++ b/app/assets/javascripts/extra/scroller.js.coffee @@ -1,13 +1,16 @@ # http://sitear.ru/material/sozdaem-knopku-naverh-scroll-to-top-na-jquery -$(window).scroll -> - if $(this).scrollTop() > 0 - $("#scroller").fadeIn() - else - $("#scroller").fadeOut() - return +$(document).ready -> + $(window).scroll -> + if $(this).scrollTop() > 0 + $("#scroller").fadeIn() + else + $("#scroller").fadeOut() + return -$("#scroller").click -> - $("body,html").animate - scrollTop: 0 - , 400 - false + $("#scroller").click -> + $("body,html").animate + scrollTop: 0 + , 400 + false + + return diff --git a/app/assets/stylesheets/custom_bootstrap.css.sass b/app/assets/stylesheets/custom_bootstrap.css.sass index 372be917c..52d7b3d23 100644 --- a/app/assets/stylesheets/custom_bootstrap.css.sass +++ b/app/assets/stylesheets/custom_bootstrap.css.sass @@ -221,7 +221,7 @@ textarea.resize-vertical #scroller position: fixed - bottom: 30px + bottom: 20px left: 20px cursor: pointer display: none diff --git a/app/views/layouts/_scroller.html.slim b/app/views/layouts/_scroller.html.slim index 97f2dbf4e..8f854ef8f 100644 --- a/app/views/layouts/_scroller.html.slim +++ b/app/views/layouts/_scroller.html.slim @@ -1 +1 @@ -#scroller.fa.fa-arrow-circle-up.fa-2x.text-primary \ No newline at end of file +#scroller.fa.fa-arrow-circle-up.fa-2x.text-primary.hidden-xs \ No newline at end of file