Skip to content

Commit

Permalink
Merge pull request #721 from sparc-request/jjh-back-to-top
Browse files Browse the repository at this point in the history
Jjh back to top
  • Loading branch information
jleonardw9 committed Nov 16, 2016
2 parents 254cd8a + a6d7aa0 commit f7b799b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/assets/javascripts/catalog.js.coffee
Expand Up @@ -106,3 +106,10 @@ $(document).ready ->
$('#modal_place').modal('show')
$('.modal #submit-error-modal').removeClass('hidden')
return false

$(window).scroll ->
if $(this).scrollTop() > 50
console.log('here')
$('.back-to-top').removeClass('hidden')
else
$('.back-to-top').addClass('hidden')
5 changes: 5 additions & 0 deletions app/assets/stylesheets/proper/service_catalog.sass
Expand Up @@ -215,3 +215,8 @@
textarea
resize: none
border: 1px solid #DDD

.back-to-top
position: fixed
right: 20px
bottom: 20px
3 changes: 3 additions & 0 deletions app/views/catalogs/_back_to_top.html.haml
@@ -0,0 +1,3 @@
%a.back-to-top.btn.btn-primary.btn-lg.hidden{href: '#', role: 'button', data: { toggle: 'tooltip', placement: 'left' }}
= t(:proper)[:catalog][:back_to_top]
%span.glyphicon.glyphicon-chevron-up
1 change: 1 addition & 0 deletions app/views/service_requests/catalog.html.haml
Expand Up @@ -26,6 +26,7 @@
= render 'catalogs/service_accordion', institutions: @institutions, ssr_org: @sub_service_request.try(:organization), locked_org_ids: @locked_org_ids
= render 'catalogs/catalog_center', service_request: @service_request, from_portal: @from_portal, organization: nil
= render 'catalogs/catalog_right', service_request: @service_request, sub_service_request: @sub_service_request, sub_service_requests: @sub_service_requests, line_items_count: @line_items_count
= render 'catalogs/back_to_top'

= render 'service_requests/modals/submit_error_modal'
= render 'service_requests/modals/new_request_modal'
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Expand Up @@ -204,7 +204,7 @@ en:
merged_totals:
header: "Study Cost Totals"
grand_total: "Grand Total"

#############
# CONSTANTS #
#############
Expand Down
1 change: 1 addition & 0 deletions config/locales/proper.en.yml
Expand Up @@ -54,6 +54,7 @@ en:
no_description: "No description available."
accordion:
header: "Browse Service Catalog"
back_to_top: "Back to Top"
center:
search_placeholder: "Search by Service Name or CPT Code..."
welcome: "Welcome to SPARCRequest: Storefront of Research Services"
Expand Down

0 comments on commit f7b799b

Please sign in to comment.