Bug 35810: Add back to top button on staff pages

Test plan:

1) Apply this patch and rebuild css with 'yarn build'
2) For example, perform a search from catalogue
3) Scroll down to see the button appear and scroll up to see it
   disappear

Note that it's works also on patron search etc..

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Thibaud Guillot 2024-01-15 11:19:51 +01:00 committed by Katrin Fischer
parent 24fab500c4
commit 926e87de86
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 22 additions and 1 deletions

View File

@ -4856,3 +4856,11 @@ div .suggestion_note {
border-bottom-right-radius: 5px;
}
}
#backtotop {
font-size: 140%;
position: fixed;
bottom: 40px;
right: 40px;
z-index: 1000;
}

View File

@ -243,7 +243,20 @@ $(document).ready(function() {
$("#bookbag_form a[href*='detail.pl?']").click(function(){
resetSearchContext();
});
// add back to top button on each staff page
$("body").append('<button id="backtotop" class="btn btn-default"><i class="fa fa-arrow-up" aria-hidden="true"></i></button>');
$("#backtotop").hide();
$(window).scroll(function(){
if ( $(window).scrollTop() < 300 ) {
$("#backtotop").fadeOut();
} else {
$("#backtotop").fadeIn();
}
});
$("#backtotop").click(function(e) {
e.preventDefault();
$("html,body").animate({scrollTop: 0}, "slow");
});
});
function removeLastBorrower(){