Added Ctrl/Meta + F to open advanced search screen

Cleanup search field onEnter
This commit is contained in:
the-djmaze 2022-03-09 15:08:22 +01:00
parent e0498895bc
commit 6f2f5bce86
11 changed files with 73 additions and 71 deletions

View file

@ -21,7 +21,7 @@ import { messagesDeleteHelper } from 'Common/Folders';
import { serverRequest } from 'Common/Links';
import { i18n, getNotification, getUploadErrorDescByCode, timestampToString } from 'Common/Translator';
import { MessageFlagsCache, setFolderHash } from 'Common/Cache';
import { doc, Settings, SettingsGet, getFullscreenElement, exitFullscreen, elementById } from 'Common/Globals';
import { doc, Settings, SettingsGet, getFullscreenElement, exitFullscreen, elementById, addShortcut } from 'Common/Globals';
import { AppUserStore } from 'Stores/User/App';
import { SettingsUserStore } from 'Stores/User/Settings';
@ -1311,40 +1311,40 @@ export class ComposePopupView extends AbstractViewPopup {
this.addAttachmentEnabled(true);
shortcuts.add('q', 'meta', ScopeCompose, ()=>false);
shortcuts.add('w', 'meta', ScopeCompose, ()=>false);
addShortcut('q', 'meta', ScopeCompose, ()=>false);
addShortcut('w', 'meta', ScopeCompose, ()=>false);
shortcuts.add('m', 'meta', ScopeCompose, () => {
addShortcut('m', 'meta', ScopeCompose, () => {
this.identitiesDropdownTrigger(true);
return false;
});
shortcuts.add('arrowdown', 'meta', ScopeCompose, () => {
addShortcut('arrowdown', 'meta', ScopeCompose, () => {
this.skipCommand();
return false;
});
shortcuts.add('s', 'meta', ScopeCompose, () => {
addShortcut('s', 'meta', ScopeCompose, () => {
this.saveCommand();
return false;
});
shortcuts.add('save', '', ScopeCompose, () => {
addShortcut('save', '', ScopeCompose, () => {
this.saveCommand();
return false;
});
if (Settings.app('allowCtrlEnterOnCompose')) {
shortcuts.add('enter', 'meta', ScopeCompose, () => {
addShortcut('enter', 'meta', ScopeCompose, () => {
this.sendCommand();
return false;
});
}
shortcuts.add('mailsend', '', ScopeCompose, () => {
addShortcut('mailsend', '', ScopeCompose, () => {
this.sendCommand();
return false;
});
shortcuts.add('escape,close', 'shift', ScopeCompose, () => {
addShortcut('escape,close', 'shift', ScopeCompose, () => {
this.tryToClosePopup();
return false;
});

View file

@ -1,3 +1,4 @@
import { addShortcut } from 'Common/Globals';
import { AbstractViewPopup } from 'Knoin/AbstractViews';
export class KeyboardShortcutsHelpPopupView extends AbstractViewPopup {
@ -10,8 +11,8 @@ export class KeyboardShortcutsHelpPopupView extends AbstractViewPopup {
const tabs = dom.querySelectorAll('.tabs input'),
last = tabs.length - 1;
// shortcuts.add('tab', 'shift',
shortcuts.add('tab,arrowleft,arrowright', '',
// addShortcut('tab', 'shift',
addShortcut('tab,arrowleft,arrowright', '',
'KeyboardShortcutsHelp',
event => {
let next = 0;

View file

@ -1,4 +1,4 @@
import { doc } from 'Common/Globals';
import { doc, addShortcut } from 'Common/Globals';
import { AbstractViewPopup } from 'Knoin/AbstractViews';
export class OpenPgpKeyPopupView extends AbstractViewPopup {
@ -118,7 +118,7 @@ export class OpenPgpKeyPopupView extends AbstractViewPopup {
}
onBuild() {
shortcuts.add('a', 'meta', 'OpenPgpKey', () => {
addShortcut('a', 'meta', 'OpenPgpKey', () => {
this.selectKey();
return false;
});