From: Bill Erickson Date: Thu, 21 Sep 2017 19:23:55 +0000 (-0400) Subject: LP#1622364 Avoid precat dialog submit on ISBN enter X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=decefb50240244a9b033e1e5c77ce63235a9322a;p=contrib%2FConifer.git 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 --- 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() {