ctrl+enter should work only on tab detail

This commit is contained in:
zadam
2019-05-19 16:56:16 +02:00
parent ecfba95841
commit ddb99a0917
4 changed files with 13 additions and 7 deletions

View File

@@ -130,13 +130,17 @@ function randomString(len) {
}
function bindShortcut(keyboardShortcut, handler) {
bindElShortcut($(document), keyboardShortcut, handler);
}
function bindElShortcut($el, keyboardShortcut, handler) {
if (isDesktop()) {
if (isMac()) {
// use CMD (meta) instead of CTRL for all shortcuts
keyboardShortcut = keyboardShortcut.replace("ctrl", "meta");
}
$(document).bind('keydown', keyboardShortcut, e => {
$el.bind('keydown', keyboardShortcut, e => {
handler();
e.preventDefault();
@@ -212,6 +216,7 @@ export default {
toObject,
randomString,
bindShortcut,
bindElShortcut,
isMobile,
isDesktop,
setCookie,