[#369] add scroller

This commit is contained in:
Alexander Machehin 2014-12-25 18:29:43 +05:00
parent b42766beb4
commit c4ddc0118d
5 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# http://sitear.ru/material/sozdaem-knopku-naverh-scroll-to-top-na-jquery
$(window).scroll ->
if $(this).scrollTop() > 0
$("#scroller").fadeIn()
else
$("#scroller").fadeOut()
return
$("#scroller").click ->
$("body,html").animate
scrollTop: 0
, 400
false

View File

@ -41,6 +41,7 @@
//= require extra/highlight
//= require extra/pull
//= require extra/scroller
//= require_self

View File

@ -218,3 +218,10 @@ textarea.resize-vertical
.update-label, .update-status, .pointer
cursor: pointer
#scroller
position: fixed
bottom: 30px
left: 20px
cursor: pointer
display: none

View File

@ -0,0 +1 @@
#scroller.fa.fa-arrow-circle-up.fa-2x.text-primary

View File

@ -33,3 +33,5 @@ html
== javascript_include_tag 'moment/ru.js', cache: 'moment'
== javascript_include_tag 'angular-locale_ru-ru', cache: 'angular-locale'
== yield :additional_scripts if content_for?(:additional_scripts)
== render '/layouts/scroller'