Bug 25653: Update tab selector to use 'active' and include all options
authorNick Clemens <nick@bywatersolutions.com>
Tue, 2 Jun 2020 14:00:25 +0000 (14:00 +0000)
committerVictor Grousset/tuxayo <victor@tuxayo.net>
Thu, 18 Jun 2020 19:16:34 +0000 (21:16 +0200)
It looks like the functionality was broken when ui tabs were upgraded
and mainmainentry was added

To test:
1 - Browse to Authorities
2 - Search in each tab
3 - Note all search results revert to 'Search main heading a only'
4 - Apply patch
5 - Note selection is retained after search

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4365b64403ba9492650e2e1733ccad8772dcdfc2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e77736c6d6683d145c7f66821c70a24c4e07e2f8)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

(cherry picked from commit e6227af570de4ec3726fcdb8dce3059ec1ef0d6f)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc

index f296601..555b8da 100644 (file)
@@ -77,12 +77,14 @@ $(document).ready(function () {
 
     var searchType = '[% marclist | html %]';
     if (searchType) {
-        if ('mainentry' == searchType) {
-            $("#header_search").tabs( "option", "selected", 0 );
+        if ('mainmainentry' == searchType) {
+            $("#header_search").tabs( "option", "active", 0 );
+        } else if ('mainentry' == searchType) {
+            $("#header_search").tabs( "option", "active", 1 );
         } else if ('match' == searchType) {
-            $("#header_search").tabs( "option", "selected", 1 );
+            $("#header_search").tabs( "option", "active", 2 );
         } else if ('all' == searchType) {
-            $("#header_search").tabs( "option", "selected", 2 );
+            $("#header_search").tabs( "option", "active", 3 );
         }
     }