Bug 32821: Fix cataloguing/value_builder/stocknumber.pl

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>
(cherry picked from commit 97c050eacb)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Julian Maurice 2023-02-03 11:58:51 +01:00 committed by Martin Renvoize
parent bb388991ac
commit 475871b3a4
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 7 additions and 3 deletions

View File

@ -39,15 +39,19 @@ my $builder = sub {
my $js = <<END_OF_JS;
<script>
function Focus$function_name(id, force) {
function set_stocknumber(id, force) {
if (\$('#' + id).val() == '' || force) {
\$('#' + id).val('$nextnum');
}
}
function Focus$function_name(event) {
set_stocknumber(event.data.id, false);
}
function Click$function_name(event) {
Focus$function_name(event.data.id, 1);
return false;
event.preventDefault();
set_stocknumber(event.data.id, true);
}
</script>
END_OF_JS