Skip to content

Commit 05f6a8b

Browse files
committed
Fixed shortcut_enabled bug and added multiple shortcut keys actions
1 parent 61f0144 commit 05f6a8b

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/gmail.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -288,16 +288,7 @@ var Gmail = function() {
288288
}
289289
}
290290

291-
if(flag_value !== undefined) {
292-
var values = {
293-
'0': true,
294-
'1': false
295-
}
296-
297-
check = values[flag_value];
298-
}
299-
300-
return check;
291+
return flag_value == '1';
301292
}
302293

303294

@@ -764,7 +755,7 @@ var Gmail = function() {
764755

765756
api.observe.shortcuts = function(action, callback) {
766757
var cb_wrapper = function(e) {
767-
if(api.tracker.shortcut_actions[action].key.indexOf(e.which) != -1) {
758+
if(api.tracker.shortcut_actions[action].keys.indexOf(e.which) != -1) {
768759
if(!(document.activeElement.nodeName == 'INPUT' || document.activeElement.nodeName == 'TEXTAREA' ||
769760
(document.activeElement.attributes.contenteditable != undefined &&
770761
document.activeElement.attributes.contenteditable.value == 'true'))) {
@@ -789,7 +780,7 @@ var Gmail = function() {
789780

790781

791782
api.tracker.shortcut_actions = {
792-
"reply" : {"keys" : [114]}
783+
"reply" : {"keys" : [114, 97]}
793784
};
794785

795786

0 commit comments

Comments
 (0)