Merge pull request #6782 from Flaburgan/redesign-back-to-top

Fix back to top not appearing on Webkit browsers + redesign
This commit is contained in:
Steffen van Bergerem 2016-04-13 21:15:35 +02:00
commit b9f5328d47
7 changed files with 13 additions and 15 deletions

View file

@ -16,7 +16,7 @@ app.views.BackToTop = Backbone.View.extend({
}, },
toggleVisibility: function() { toggleVisibility: function() {
if($("html, body").scrollTop() > 1000) { if($(document).scrollTop() > 1000) {
$("#back-to-top").addClass("visible"); $("#back-to-top").addClass("visible");
} else { } else {
$("#back-to-top").removeClass("visible"); $("#back-to-top").removeClass("visible");

View file

@ -65,22 +65,25 @@ pre { word-wrap: break-word; }
.back-to-top { .back-to-top {
background-color: $border-dark-grey; background-color: $border-dark-grey;
border-radius: 10px; border-radius: 4px;
bottom: 20px; bottom: 20px;
color: $white; color: $white;
display: block; display: block;
font-size: 2.9em; font-size: 3.5em;
line-height: 1.5; height: 50px;
line-height: 50px;
opacity: 0; opacity: 0;
padding: 0 12px;
position: fixed; position: fixed;
right: 54px; right: 54px;
transition: opacity ease 400ms;
width: 50px;
z-index: 49; z-index: 49;
&:hover, &:hover,
&.visible:hover { &.visible:hover {
color: $white; color: $white;
opacity: .85; opacity: .85;
text-decoration: none;
} }
&.visible { opacity: .5; } &.visible { opacity: .5; }

View file

@ -17,8 +17,7 @@
= render partial: 'people/person', locals: hash = render partial: 'people/person', locals: hash
= will_paginate @contacts_of_contact, renderer: WillPaginate::ActionView::BootstrapLinkRenderer = will_paginate @contacts_of_contact, renderer: WillPaginate::ActionView::BootstrapLinkRenderer
%a.back-to-top#back-to-top{title: "#{t('layouts.application.back_to_top')}", href: "#"} %a.entypo-chevron-up.back-to-top#back-to-top{title: "#{t('layouts.application.back_to_top')}", href: "#"}
⇧
-if user_signed_in? && @person -if user_signed_in? && @person
#new_status_message_pane #new_status_message_pane

View file

@ -37,8 +37,7 @@
= will_paginate(@people) = will_paginate(@people)
%a.back-to-top#back-to-top{title: "#{t('layouts.application.back_to_top')}", href: "#"} %a.entypo-chevron-up.back-to-top#back-to-top{title: "#{t('layouts.application.back_to_top')}", href: "#"}
⇧
.col-md-4 .col-md-4
- if AppConfig.settings.invitations.open? - if AppConfig.settings.invitations.open?

View file

@ -27,8 +27,7 @@
%span.loader.hidden %span.loader.hidden
.spinner .spinner
%a.back-to-top#back-to-top{title: "#{t('layouts.application.back_to_top')}", href: "#"} %a.entypo-chevron-up.back-to-top#back-to-top{title: "#{t('layouts.application.back_to_top')}", href: "#"}
⇧
-if user_signed_in? && @person -if user_signed_in? && @person
#new_status_message_pane #new_status_message_pane

View file

@ -158,5 +158,4 @@
.stream_container#aspect_stream_container .stream_container#aspect_stream_container
= render "aspects/aspect_stream", stream: @stream = render "aspects/aspect_stream", stream: @stream
%a.back-to-top#back-to-top{title: "#{t('layouts.application.back_to_top')}", href: "#"} %a.entypo-chevron-up.back-to-top#back-to-top{title: "#{t('layouts.application.back_to_top')}", href: "#"}
⇧

View file

@ -34,5 +34,4 @@
%span.loader.hidden %span.loader.hidden
.spinner .spinner
%a.back-to-top#back-to-top{title: "#{t('layouts.application.back_to_top')}", href: "#"} %a.entypo-chevron-up.back-to-top#back-to-top{title: "#{t('layouts.application.back_to_top')}", href: "#"}
⇧