LP1826584 Spacebar closes alert/cofirm dialogs (angjs)
authorBill Erickson <berickxx@gmail.com>
Thu, 23 May 2019 16:52:29 +0000 (12:52 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 23 May 2019 16:53:56 +0000 (12:53 -0400)
AngularJS alert and confirm dialogs may now be closed with the space bar
in addition to the escape key.  Note for confirm dialogs, space bar is
the same as clicking the "OK/Continue" button.

Signed-off-by: a. bellenir <ab@grpl.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/templates/staff/share/t_alert_dialog.tt2
Open-ILS/src/templates/staff/share/t_confirm_dialog.tt2

index b71614a..bee3c75 100644 (file)
@@ -2,7 +2,7 @@
   Generic alert dialog.
   The only user action allowed is the 'OK' button.
 -->
-<div>
+<div ng-keypress="$event.keyCode===32 && ok()" tabindex="0" autofocus>
   <div class="modal-header">
     <button type="button" class="close" 
       ng-click="ok()" aria-hidden="true">&times;</button>
index c701886..f26e686 100644 (file)
@@ -1,7 +1,7 @@
 <!--
   Generic confirmation dialog
 -->
-<div>
+<div ng-keypress="$event.keyCode===32 && ok()" tabindex="0" autofocus>
   <div class="modal-header">
     <button type="button" class="close" 
       ng-click="cancel()" aria-hidden="true">&times;</button>