static/js/common: Extract function has_mac_keyboard.

This commit is contained in:
Yashashvi Dave
2019-06-10 12:39:04 +05:30
committed by Tim Abbott
parent e2549b3b84
commit 371343709b
8 changed files with 11 additions and 6 deletions

View File

@@ -128,7 +128,7 @@ exports.get_keydown_hotkey = function (e) {
}
}
var isCmdOrCtrl = /Mac/i.test(navigator.userAgent) ? e.metaKey : e.ctrlKey;
var isCmdOrCtrl = common.has_mac_keyboard() ? e.metaKey : e.ctrlKey;
if (isCmdOrCtrl && !e.shiftKey) {
hotkey = keydown_cmd_or_ctrl_mappings[e.which];
if (hotkey) {