mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-09 06:28:28 +03:00
Cleanup knockout commands and replaced EventKeyCode with native KeyboardEvent.key
This commit is contained in:
parent
d06fed09d6
commit
7ac8143f34
9 changed files with 87 additions and 118 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { inFocus } from 'Common/Utils';
|
||||
import { KeyState, EventKeyCode } from 'Common/Enums';
|
||||
import { KeyState } from 'Common/Enums';
|
||||
import { keyScope } from 'Common/Globals';
|
||||
|
||||
export class AbstractViewNext {
|
||||
|
|
@ -35,12 +35,12 @@ export class AbstractViewNext {
|
|||
* @returns {void}
|
||||
*/
|
||||
registerPopupKeyDown() {
|
||||
addEventListener('keydown', (event) => {
|
||||
addEventListener('keydown', event => {
|
||||
if (event && this.modalVisibility && this.modalVisibility()) {
|
||||
if (!this.bDisabeCloseOnEsc && EventKeyCode.Esc === event.keyCode) {
|
||||
if (!this.bDisabeCloseOnEsc && 'Escape' == event.key) {
|
||||
this.cancelCommand && this.cancelCommand();
|
||||
return false;
|
||||
} else if (EventKeyCode.Backspace === event.keyCode && !inFocus()) {
|
||||
} else if ('Backspace' == event.key && !inFocus()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue