Bug 32813: Fix cataloguing/value_builder/barcode.pl
authorJulian Maurice <julian.maurice@biblibre.com>
Fri, 3 Feb 2023 10:58:50 +0000 (11:58 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 20 Feb 2023 12:44:10 +0000 (09:44 -0300)
Use event parameter instead of id.

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
cataloguing/value_builder/barcode.pl

index e5a0966..bd4a927 100755 (executable)
@@ -86,14 +86,16 @@ END_OF_JS
 
     my $js  = <<END_OF_JS;
 <script>
-
-function Focus$function_name(id, force) {
+function set_barcode(id, force) {
 $scr
 }
 
-function Click$function_name(id) {
-    Focus$function_name(id, 1);
-    return false;
+function Focus$function_name(event) {
+    set_barcode(event.data.id, false);
+}
+
+function Click$function_name(event) {
+    set_barcode(event.data.id, true);
 }
 </script>
 END_OF_JS