webstaff: Allow hotkeys to work in form elements
authorMike Rylander <mrylander@gmail.com>
Tue, 3 Mar 2015 17:23:55 +0000 (12:23 -0500)
committerJason Stephenson <jstephenson@mvlc.org>
Wed, 19 Aug 2015 17:39:11 +0000 (13:39 -0400)
We may need to use the underlying Mousetrap library directly, however

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/web/js/ui/default/staff/services/navbar.js

index 37bed18..1d7f0ad 100644 (file)
@@ -42,7 +42,12 @@ angular.module('egCoreMod')
                 // adds a keyboard shortcut
                 // http://chieffancypants.github.io/angular-hotkeys/
                 $scope.addHotkey = function(key, path, desc) {                 
-                    hotkeys.add(key, desc, function(e) { e.preventDefault();  navTo(path); });
+                    hotkeys.add({
+                        combo: key,
+                        allowIn: ['INPUT','SELECT','TEXTAREA'],
+                        description: desc,
+                        callback: function(e) { e.preventDefault();  navTo(path); }
+                    });
                 };
 
                 $scope.retrieveLastRecord = function() {