From 3e95dee58c0ca8ef8ab203808dde81dd2ef78c1e Mon Sep 17 00:00:00 2001 From: Flaburgan Date: Mon, 4 Apr 2016 11:16:29 +0200 Subject: [PATCH 1/2] Fix back to top icon not appearing on webkit browsers --- app/assets/javascripts/app/views/back_to_top_view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/views/back_to_top_view.js b/app/assets/javascripts/app/views/back_to_top_view.js index 66c516475..0289c8fb0 100644 --- a/app/assets/javascripts/app/views/back_to_top_view.js +++ b/app/assets/javascripts/app/views/back_to_top_view.js @@ -16,7 +16,7 @@ app.views.BackToTop = Backbone.View.extend({ }, toggleVisibility: function() { - if($("html, body").scrollTop() > 1000) { + if($(document).scrollTop() > 1000) { $("#back-to-top").addClass("visible"); } else { $("#back-to-top").removeClass("visible"); From f2b75af08cde9cb703164d5b5e264d9b7da50b9c Mon Sep 17 00:00:00 2001 From: Flaburgan Date: Mon, 4 Apr 2016 11:16:55 +0200 Subject: [PATCH 2/2] Back to top arrow redesign --- app/assets/stylesheets/base.scss | 11 +++++++---- app/views/people/contacts.haml | 3 +-- app/views/people/index.html.haml | 3 +-- app/views/people/show.html.haml | 3 +-- app/views/streams/main_stream.html.haml | 3 +-- app/views/tags/show.haml | 3 +-- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/assets/stylesheets/base.scss b/app/assets/stylesheets/base.scss index c05454901..6356b0631 100644 --- a/app/assets/stylesheets/base.scss +++ b/app/assets/stylesheets/base.scss @@ -65,22 +65,25 @@ pre { word-wrap: break-word; } .back-to-top { background-color: $border-dark-grey; - border-radius: 10px; + border-radius: 4px; bottom: 20px; color: $white; display: block; - font-size: 2.9em; - line-height: 1.5; + font-size: 3.5em; + height: 50px; + line-height: 50px; opacity: 0; - padding: 0 12px; position: fixed; right: 54px; + transition: opacity ease 400ms; + width: 50px; z-index: 49; &:hover, &.visible:hover { color: $white; opacity: .85; + text-decoration: none; } &.visible { opacity: .5; } diff --git a/app/views/people/contacts.haml b/app/views/people/contacts.haml index b5edec9b0..34da88215 100644 --- a/app/views/people/contacts.haml +++ b/app/views/people/contacts.haml @@ -17,8 +17,7 @@ = render partial: 'people/person', locals: hash = 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 #new_status_message_pane diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml index 79a2f6595..f8a310fb8 100644 --- a/app/views/people/index.html.haml +++ b/app/views/people/index.html.haml @@ -37,8 +37,7 @@ = 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 - if AppConfig.settings.invitations.open? diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 0deab6f09..3f4ad5bbd 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -27,8 +27,7 @@ %span.loader.hidden .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 #new_status_message_pane diff --git a/app/views/streams/main_stream.html.haml b/app/views/streams/main_stream.html.haml index 25c4155c5..b3bad24dd 100644 --- a/app/views/streams/main_stream.html.haml +++ b/app/views/streams/main_stream.html.haml @@ -158,5 +158,4 @@ .stream_container#aspect_stream_container = 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: "#"} diff --git a/app/views/tags/show.haml b/app/views/tags/show.haml index ebb468b28..8f18a8261 100644 --- a/app/views/tags/show.haml +++ b/app/views/tags/show.haml @@ -34,5 +34,4 @@ %span.loader.hidden .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: "#"}