Bug 32814: Fix cataloguing/value_builder/callnumber-KU.pl
authorJulian Maurice <julian.maurice@biblibre.com>
Fri, 3 Feb 2023 10:58:51 +0000 (11:58 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 20 Feb 2023 12:54:13 +0000 (09:54 -0300)
Use event parameter

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: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
cataloguing/value_builder/callnumber-KU.pl

index 37b7e16..d6327a5 100755 (executable)
@@ -46,8 +46,9 @@ my $builder = sub {
     my ( $params ) = @_;
     my $res="
     <script>
-        function Click$params->{id}() {
-                var code = document.getElementById('$params->{id}');
+        function Click$params->{id}(ev) {
+                ev.preventDefault();
+                var code = document.getElementById(ev.data.id);
                 var url = '../cataloguing/plugin_launcher.pl?plugin_name=callnumber-KU.pl&code=' + code.value;
                 var req = \$.get(url);
                 req.done(function(resp){