Recover auto search submission on sort selector change
authorBill Erickson <berickxx@gmail.com>
Tue, 17 Mar 2015 20:10:04 +0000 (16:10 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Avoid applying two onchange() handlers to a single element, since only
one will ever fire.  In this case, the extra handler prevented the
automatic form submission from running a new search.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/openils/var/templates_kcls/opac/parts/filtersort.tt2

index 72072ca..65a0733 100644 (file)
@@ -1,7 +1,8 @@
        <!-- Onchange below is part of a hack to keep the Sort Results order selector persistent across multiple searches in single tab 
                 see templates_kcls/opac/parts/search.tt2 and simple.js-->
-<select class="results_header_sel" id='opac.result.sort' name="sort" onchange="setPersistentSort();"
-    [% IF submit_on_change %]onchange='this.form.submit()'[% END %]>
+<select class="results_header_sel" id='opac.result.sort' name="sort" 
+    [% IF submit_on_change %]onchange="setPersistentSort();this.form.submit()"
+    [% ELSE %]onchange="setPersistentSort()"[% END %]>
     <option value=''>[% l("Sort by Relevance") %]</option>
     <optgroup label='[% l("Sort by Title") %]'>
         <option value='titlesort'[% value == 'titlesort' ? ' selected="selected"' : '' %]>[% l("Title: A to Z") %]</option>