From 4ab6379cefc3fa305cf9533d331e4daecfc3fc27 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 24 Apr 2020 00:51:35 +0000 Subject: [PATCH] Bug 25271: Add floating toolbar to OPAC cart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds JavaScript to the OPAC cart view so that the toolbar at the top of the display "floats" as you scroll down. The patch also makes a minor correction to the OPAC SCSS affecting the display of the buttons in the cart toolbar. To test, apply the patch and rebuild the OPAC CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Add some items to a cart in the OPAC. - Open the cart and confirm that the toolbar sticks to the top of the window as you scroll down. - Confirm that it works in the "More details" view. - Confirm that other JavaScript-based operations are not affected: table sorting and all the various toolbar buttons. Signed-off-by: Frédéric Demians --- .../bootstrap/css/src/_responsive.scss | 2 +- .../opac-tmpl/bootstrap/css/src/opac.scss | 5 - .../bootstrap/en/modules/opac-basket.tt | 99 ++++++++++--------- 3 files changed, 55 insertions(+), 51 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss index 6a718ce3d8..1dec8de4fb 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss @@ -558,4 +558,4 @@ .userlabel { display: none; } -} \ No newline at end of file +} diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index 2fec169b94..d78fd167a7 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -112,11 +112,6 @@ a { vertical-align: middle; } - &.brief { - - padding-left: 27px; - } - &.addtocart { padding-right: 0; } diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt index 415ed112fe..a53000b55c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt @@ -17,51 +17,53 @@

Your cart

-
- [% IF ( verbose ) %] - Brief display - [% ELSE %] - More details - [% END %] - [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] - Send - [% END %] - Download - Empty and close - Hide window - [% IF ( verbose ) %] - Print - [% END %] -
- -
- Select all - Clear all - | - - Select titles to: - Remove - [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %] - [% IF ( ( Koha.Preference( 'virtualshelves' ) == 1 ) && loggedinusername ) %] - Add to a list - [% END %] - [% IF ( Koha.Preference( 'RequestOnOpac' ) == 1 ) %] - Place hold - [% END %] - [% IF ( TagsInputEnabled && loggedinusername ) %] - Tag - [% END %] - [% END # / IF opacuserlogin %] - - [% IF ( TagsInputEnabled && loggedinusername ) %] - - [% END %] -
+
+
+ [% IF ( verbose ) %] + Brief display + [% ELSE %] + More details + [% END %] + [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] + Send + [% END %] + Download + Empty and close + Hide window + [% IF ( verbose ) %] + Print + [% END %] +
+ +
+ Select all + Clear all + | + + Select titles to: + Remove + [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %] + [% IF ( ( Koha.Preference( 'virtualshelves' ) == 1 ) && loggedinusername ) %] + Add to a list + [% END %] + [% IF ( Koha.Preference( 'RequestOnOpac' ) == 1 ) %] + Place hold + [% END %] + [% IF ( TagsInputEnabled && loggedinusername ) %] + Tag + [% END %] + [% END # / IF opacuserlogin %] + + [% IF ( TagsInputEnabled && loggedinusername ) %] + + [% END %] +
+
[% IF ( verbose ) %]
@@ -304,6 +306,7 @@ [% BLOCK jsinclude %] [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] + [% Asset.js("lib/hc-sticky.js") | $raw %] [% INCLUDE 'datatables.inc' %]