diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 0a055cfe50..183e5d65bb 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -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; +} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index 7e4567bc59..8376faa6c5 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -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(''); + $("#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(){