@@ -, +, @@ --- koha-tmpl/intranet-tmpl/prog/en/js/holds.js | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/js/holds.js +++ a/koha-tmpl/intranet-tmpl/prog/en/js/holds.js @@ -1,7 +1,13 @@ $(document).ready(function() { - // Don't load holds table unless it is clicked on var holdsTable; - $("#holds-tab").click( function() { + + // Don't load holds table unless it is clicked on + $("#holds-tab").on( "click", function(){ load_holds_table() } ); + + // If the holds tab is preselected on load, we need to load the table + if ( $("#holds-tab").parent().hasClass('ui-state-active') ) { load_holds_table() } + + function load_holds_table() { if ( ! holdsTable ) { holdsTable = $("#holds-table").dataTable({ "bAutoWidth": false, @@ -127,6 +133,5 @@ $(document).ready(function() { }); } } - }); - + } }); --