From: Mike Rylander Date: Tue, 21 Mar 2017 14:22:59 +0000 (-0400) Subject: webstaff: Allow multiple hotkeys for a single action X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c06136c66b1a0f0ada8f5f2ef901344022fa6bbf;p=evergreen%2Fmasslnc.git webstaff: Allow multiple hotkeys for a single action Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/web/js/ui/default/staff/services/navbar.js b/Open-ILS/web/js/ui/default/staff/services/navbar.js index ec00a9a738..d36d40e6c0 100644 --- a/Open-ILS/web/js/ui/default/staff/services/navbar.js +++ b/Open-ILS/web/js/ui/default/staff/services/navbar.js @@ -41,15 +41,17 @@ angular.module('egCoreMod') // adds a keyboard shortcut // http://chieffancypants.github.io/angular-hotkeys/ $scope.addHotkey = function(key, path, desc, elm) { - hotkeys.add({ - combo: key, - allowIn: ['INPUT','SELECT','TEXTAREA'], - description: desc, - callback: function(e) { - e.preventDefault(); - if (path) return navTo(path); - return $timeout(function(){$(elm).trigger('click')}); - } + angular.forEach(key.split(' '), function (k) { + hotkeys.add({ + combo: k, + allowIn: ['INPUT','SELECT','TEXTAREA'], + description: desc, + callback: function(e) { + e.preventDefault(); + if (path) return navTo(path); + return $timeout(function(){$(elm).trigger('click')}); + } + }); }); };