From dca24450b1ff2ac56133f6073832277acbdffe7b Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 21 Sep 2017 15:23:55 -0400 Subject: [PATCH] LP#1622364 Avoid precat dialog submit on ISBN enter Avoid submitting the precat copy checkout entry form when the Enter key is pressed on the ISBN field. Do this to allow scanners to enter ISBN data without automatically submitting the form. Signed-off-by: Bill Erickson Signed-off-by: Cesar Velez Signed-off-by: Galen Charlton --- Open-ILS/src/templates/staff/circ/share/t_precat_dialog.tt2 | 1 + Open-ILS/web/js/ui/default/staff/circ/services/circ.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Open-ILS/src/templates/staff/circ/share/t_precat_dialog.tt2 b/Open-ILS/src/templates/staff/circ/share/t_precat_dialog.tt2 index 1410f9e806..0601782fdb 100644 --- a/Open-ILS/src/templates/staff/circ/share/t_precat_dialog.tt2 +++ b/Open-ILS/src/templates/staff/circ/share/t_precat_dialog.tt2 @@ -23,6 +23,7 @@
diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js index 27755fe3b5..b8f0d60a39 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js @@ -826,6 +826,13 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, $scope.circModifiers = circMods; $scope.ok = function(args) { $uibModalInstance.close(args) } $scope.cancel = function () { $uibModalInstance.dismiss() } + + // use this function as a keydown handler on form + // elements that should not submit the form on enter. + $scope.preventSubmit = function($event) { + if ($event.keyCode == 13) + $event.preventDefault(); + } }], resolve : { circMods : function() { -- 2.11.0