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>
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