From 0899e697be6799d84c95c271f8e2c9e8113290d8 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 30 Jul 2021 10:54:47 +0000 Subject: [PATCH] Bug 28764: Alter sort dropdown to use direction parameter This code is odd -we build a select in the template, then turn it into a list of links using javascript This patch adds a direction data element and uses it while building the links --- .../bootstrap/en/modules/opac-shelves.tt | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index b9d3c0858d..08b7f668a6 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -265,62 +265,62 @@ [% IF sortfield == 'author' && direction == 'asc' %] - + [% ELSE %] - + [% END %] [% IF sortfield == 'author' && direction == 'desc' %] - + [% ELSE %] - + [% END %] [% IF sortfield == 'title' && direction == 'asc' %] - + [% ELSE %] - + [% END %] [% IF sortfield == 'title' && direction == 'desc' %] - + [% ELSE %] - + [% END %] [% IF sortfield == 'itemcallnumber' && direction == 'asc' %] - + [% ELSE %] - + [% END %] [% IF sortfield == 'itemcallnumber' && direction == 'desc' %] - + [% ELSE %] - + [% END %] [% IF sortfield == 'copyrightdate' && direction == 'asc' %] - + [% ELSE %] - + [% END %] [% IF sortfield == 'copyrightdate' && direction == 'desc' %] - + [% ELSE %] - + [% END %] [% IF sortfield == "dateadded" && direction == 'asc' %] - + [% ELSE %] - + [% END %] [% IF sortfield == "dateadded" && direction == 'desc' %] - + [% ELSE %] - + [% END %] @@ -1083,7 +1083,7 @@ function sortMenu( sorting_form ){ menu += "" + $(this).attr("label") + ""; $(this).children().each(function(){ if( $(this)[0].tagName.toUpperCase() == "OPTION" ){ - menu += "" + $(this).text() + ""; + menu += "" + $(this).text() + ""; } }); } -- 2.20.1