From 2047cd98db63653f16d6827751a4bf64f175a082 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 6 Aug 2021 07:28:12 +0000 Subject: [PATCH] Bug 28821: (follow-up) Improve operation of button plus/less Follow-up for bug 28784. Do not remove the op select on the first row. Allow plus/less on all lines. Allow less until we have one line left. Make sure that first op is disabled and hidden with plus/less. Test plan: Search on multiple indexes on advanced search. Verify that plus/minus works as expected. Signed-off-by: Marcel de Rooy Signed-off-by: Fridolin Somers Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- .../opac-tmpl/bootstrap/en/modules/opac-advsearch.tt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt index e13a918c4a..f7842ba6ba 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt @@ -40,13 +40,11 @@
[% IF ( expanded_options ) %] - [% IF ( !loop.first ) %] - [% END %] [% ELSE %]
[% IF ( expanded_options ) %]
- [% IF ( !loop.first ) %] - [% END %]
[% END %]
@@ -477,7 +473,8 @@ $(document).ready(function() { $('#advsearches').tabs(); jQuery.cookie.json = true; - //$('#advsearches > ul').tabs(); + + $('.search-term-row .search-term-input select[name="op"]').first().prop("disabled",true).hide(); [% IF ( ReturnToSearch ) %] if (form_serialized = jQuery.cookie("form_serialized")) { @@ -540,16 +537,18 @@ $(document).ready(function() { $('.ButtonLess').show(); var thisLine = $(this).parent().parent(); var newLine = thisLine.clone(); + $(newLine).find('.search-term-input select[name="op"]').first().prop("disabled",false).show(); newLine.find('input').val(''); thisLine.after(newLine); }); $(document).on("click", '.ButtonLess', function(e) { e.preventDefault(); - if($(this).parent().parent().siblings().length <= 3 ) { + if($(this).parent().parent().siblings().length < 2 ) { $('.ButtonLess').hide(); } $(this).parent().parent().remove(); + $('.search-term-row .search-term-input select[name="op"]').first().prop("disabled",true).hide(); }); -- 2.39.5