Bugzilla – Attachment 130902 Details for
Bug 30136
Add back to top button when scrolling
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30136: Add back to top button to OPAC
Bug-30136-Add-back-to-top-button-to-OPAC.patch (text/plain), 1.86 KB, created by
ByWater Sandboxes
on 2022-02-18 22:16:06 UTC
(
hide
)
Description:
Bug 30136: Add back to top button to OPAC
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2022-02-18 22:16:06 UTC
Size:
1.86 KB
patch
obsolete
>From 5dabf047fba0f5f913be35ce5637926726aef976 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 18 Feb 2022 10:44:14 -1000 >Subject: [PATCH] Bug 30136: Add back to top button to OPAC > >Like in many websites, when scrolling down the page make a button appear to go back to top. >This can be very useful specially in search results page. > >This patch adds to OPAC using Javascript a button with id "backtotop". >Button appears when 300 pixels from top are hidden. >This value may be adapted. > >Test plan >1) Go to OPAC >2) Perform a search with many results >3) Scroll down >=> Back to top button appears >4) Manually scroll back to top >=> Button disappears >5) Scroll down and click on Back to top button >=> You get to top > >Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> >--- > .../bootstrap/en/includes/opac-bottom.inc | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >index 5398bf3fcb..8e0762e9eb 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -217,6 +217,20 @@ $.widget.bridge('uitooltip', $.ui.tooltip); > return confirmDelete(MSG_DELETE_SEARCH_HISTORY); > }); > >+ $("body").append('<button id="backtotop" class="btn btn-primary"><i class="fa fa-arrow-up"></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"); >+ }); >+ > </script> > > [% IF Koha.Preference( 'opacbookbag' ) == 1 %] >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30136
:
130896
|
130897
|
130898
|
130902
|
130903
|
133219
|
133220
|
133737
|
134011
|
134012
|
134063
|
134064