Bugzilla – Attachment 189592 Details for
Bug 19814
Batch Check-in function
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19814: Polishing js in template
Bug-19814-Polishing-js-in-template.patch (text/plain), 3.47 KB, created by
Marcel de Rooy
on 2025-11-14 11:13:06 UTC
(
hide
)
Description:
Bug 19814: Polishing js in template
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-11-14 11:13:06 UTC
Size:
3.47 KB
patch
obsolete
>From 28f9527cf2145c0e26fa4e36c37e3fb7dc5a5bb4 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 14 Nov 2025 12:05:23 +0100 >Subject: [PATCH] Bug 19814: Polishing js in template >Content-Type: text/plain; charset=utf-8 > >When going back to single mode, we should respond to Enter again. >Remove enabling the batch mode from the input event. >Obsoleting variable isReceivingRFIDInput. >--- > .../prog/en/modules/circ/returns.tt | 36 +++++-------------- > 1 file changed, 9 insertions(+), 27 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index 00dd18378d..df41206a9a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -1919,9 +1919,8 @@ > ], > }); > >- // Debounce variables for RFID batch input >+ // Debounce variable for RFID batch input > let debounceTimer; >- let isReceivingRFIDInput = false; > > // Batch mode toggle functionality > $('#batch-mode-toggle').on('change', function() { >@@ -1957,43 +1956,26 @@ > > // Handle RFID input with debouncing > $('#barcode').on('input paste', function(e) { >- const currentValue = $(this).val(); >- >- // Clear any existing timer >- clearTimeout(debounceTimer); >- >- // Check if this looks like RFID batch input (contains newlines) >- if (currentValue.includes('\n')) { >- isReceivingRFIDInput = true; >- >- // Auto-enable batch mode if not already enabled >- if (!$('#batch-mode-toggle').is(':checked')) { >- $('#batch-mode-toggle').prop('checked', true).trigger('change'); >- } >- >- // Set a debounce timer to submit after RFID scanning finishes >+ clearTimeout(debounceTimer); // Clear any existing timer >+ if ( $(this).val().match('\n$') ) { >+ // After a newline (in batch mode), set debounce timer >+ // Form submits when there is no further input > debounceTimer = setTimeout(function() { >- isReceivingRFIDInput = false; >- ChangeBatchCheckinSettings(); > $('#checkin-form').submit(); > }, debounceInterval); // delay after last input > } > }); > >- // Prevent immediate form submission on Enter if receiving RFID input >+ // Only submit after Enter in single mode > $('#barcode').on('keydown', function(e) { >- if (e.which === 13 && isReceivingRFIDInput) { >+ if ( e.which === 13 && !$('#batch-mode-toggle').prop('checked') ) { > e.preventDefault(); >- return false; >+ $('#checkin-form').submit(); > } > }); > >- // Prevent form submission during RFID input > $('#checkin-form').on('submit', function(e) { >- if (isReceivingRFIDInput) { >- e.preventDefault(); >- return false; >- } >+ ChangeBatchCheckinSettings(); > }); > > [% IF ( !(Koha.Preference('TransfersBlockCirc')) && Koha.Preference('AutomaticConfirmTransfer') ) %] >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19814
:
186374
|
186375
|
189487
|
189488
|
189489
|
189490
|
189529
|
189568
|
189586
|
189587
|
189588
|
189589
|
189590
|
189591
| 189592