Bug 36302: Reinstate defer_loading

defer_loading is now a patron_search_js BLOCK param - default on

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Pedro Amorim 2024-03-25 17:14:01 +00:00 committed by Katrin Fischer
parent 4e04ff28b6
commit dcb98892cd
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 4 additions and 4 deletions

View File

@ -226,6 +226,7 @@
[%# callback: name of the JS function that will be called when a patron is selected. Only work with action=select %]
[%# display_search_description: boolean, default off. Display the description of the search %]
[%# adjust_history: boolean, default off. Change the current url when a first letter is selected %]
[%# defer_loading: boolean, default on. If true, it will not load the table until a search is triggered %]
[% BLOCK patron_search_js %]
[% IF redirect_if_one_result && !redirect_url %]
@ -293,7 +294,7 @@
let Sticky;
let singleBranchMode = '[% singleBranchMode | html %]';
let logged_in_library_id = "[% Branches.GetLoggedInBranchcode | html %]";
let defer_loading = Number( '[% defer_loading | html %]' || 1 );
[% IF adjust_history %]
/* popstate event triggered by forward and back button. Need to refresh search */
window.addEventListener('popstate', (event) => {
@ -724,8 +725,7 @@
patron_search_form.find(".searchpattern").parent().hide();
});
let urlParams = new URLSearchParams(window.location.search);
if(urlParams.size > 0){
if ( !defer_loading ) {
patron_search_form.submit();
}

View File

@ -347,7 +347,7 @@
[% ELSE %]
[% SET redirect_url = '/cgi-bin/koha/members/moremember.pl' %]
[% END %]
[% PROCESS patron_search_js table_id => 'memberresultst', categories => categories, libraries => libraries, columns => columns,actions => ['edit', 'checkout'], redirect_if_one_result => 1, redirect_url => redirect_url, sticky_header => "searchheader", sticky_to => "searchresults", default_sort_column => 'name-address', display_search_description => 1, remember_selections => 1, adjust_history => 1 %]
[% PROCESS patron_search_js defer_loading => defer_loading, table_id => 'memberresultst', categories => categories, libraries => libraries, columns => columns,actions => ['edit', 'checkout'], redirect_if_one_result => 1, redirect_url => redirect_url, sticky_header => "searchheader", sticky_to => "searchresults", default_sort_column => 'name-address', display_search_description => 1, remember_selections => 1, adjust_history => 1 %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]