Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jjh back to top #721

Merged
merged 3 commits into from
Nov 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/assets/javascripts/catalog.js.coffee
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,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
Original file line number Diff line number Diff line change
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