@@ -, +, @@
---
koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss | 10 ++++++++++
.../bootstrap/en/includes/opac-bottom.inc | 14 --------------
koha-tmpl/opac-tmpl/bootstrap/js/global.js | 17 ++++++++++++++++-
3 files changed, 26 insertions(+), 15 deletions(-)
--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss
+++ a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss
@@ -225,6 +225,16 @@ th {
}
}
+#backtotop {
+ display: inline-block;
+ text-align: center;
+ font-size: 120%;
+ position: fixed;
+ bottom: 40px;
+ right: 40px;
+ z-index: 1000;
+}
+
#booleansearch {
width: 80%;
}
--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc
@@ -213,20 +213,6 @@
return confirmDelete(MSG_DELETE_SEARCH_HISTORY);
});
- $("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");
- });
-
[% IF Koha.Preference( 'opacbookbag' ) == 1 %]
--- a/koha-tmpl/opac-tmpl/bootstrap/js/global.js
+++ a/koha-tmpl/opac-tmpl/bootstrap/js/global.js
@@ -1,4 +1,4 @@
-/* global enquire readCookie updateBasket delCookie */
+/* global enquire readCookie updateBasket delCookie __ */
(function( w ){
// if the class is already set, the font has already been loaded
if( w.document.documentElement.className.indexOf( "fonts-loaded" ) > -1 ){
@@ -231,4 +231,19 @@ $(document).ready(function(){
});
$('[data-toggle="tooltip"]').tooltip();
+
+ /* Scroll back to top button */
+ $("body").append('');
+ $("#backtotop").hide();
+ $(window).on("scroll", function(){
+ if ( $(window).scrollTop() < 300 ) {
+ $("#backtotop").fadeOut();
+ } else {
+ $("#backtotop").fadeIn();
+ }
+ });
+ $("#backtotop").on("click", function(e) {
+ e.preventDefault();
+ $("html,body").animate({scrollTop: 0}, "slow");
+ });
});
--