Bug 35600: Prevent checkouts table to flicker

The checkouts table is displayed in the DOM then hidden in JS, then we show it if the cookie is set.

This patch makes the table hidden by default, and show it if/when needed

Test plan:
Check an item out, see the checkouts list view
Play with "Always show checkouts automatically", refresh the page
=> UI should behave better than before this patch

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2023-12-19 11:45:59 +01:00 committed by Katrin Fischer
parent d6314d3224
commit 6c8beb2f2e
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 2 additions and 4 deletions

View File

@ -16,7 +16,7 @@
</p>
</div>
<form name="issues" action="/cgi-bin/koha/tools/export.pl" method="post">
<table id="issues-table" style="width: 100% !Important;">
<table id="issues-table" style="width: 100% !Important; display: none;">
<thead>
<tr>
<th scope="col">&nbsp;</th>
@ -49,7 +49,7 @@
<label for="issues-table-load-immediately">Always show checkouts automatically</label>
<input id="issues-table-load-immediately" type="checkbox" />
<div id="issues-table-actions">
<div id="issues-table-actions" style="display: none;">
<fieldset class="action">
[% IF ( CAN_user_circulate_override_renewals ) %]
[% IF Koha.Preference( 'AllowRenewalLimitOverride' ) || Koha.Preference( 'AllowRenewalOnHoldOverride' ) %]

View File

@ -265,8 +265,6 @@ $(document).ready(function() {
var ymd = flatpickr.formatDate(new Date(), "Y-m-d");
$('#issues-table').hide();
$('#issues-table-actions').hide();
$('#issues-table-load-immediately').change(function(){
if ( this.checked && typeof issuesTable === 'undefined') {
$('#issues-table-load-now-button').click();