mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
Upgraded some old JavaScript to ECMAScript 1.6
Removed some jQuery references Added JavaScript Globals.$htmlCL for frequently used window.document.documentElement.classList
This commit is contained in:
parent
a6a337e5ce
commit
0b0747b8dc
19 changed files with 142 additions and 151 deletions
|
|
@ -1,8 +1,9 @@
|
|||
import ko from 'ko';
|
||||
import window from 'window';
|
||||
|
||||
import { delegateRun, inFocus } from 'Common/Utils';
|
||||
import { KeyState, EventKeyCode } from 'Common/Enums';
|
||||
import { $win, keyScope } from 'Common/Globals';
|
||||
import { keyScope } from 'Common/Globals';
|
||||
|
||||
export class AbstractViewNext {
|
||||
bDisabeCloseOnEsc = false;
|
||||
|
|
@ -35,7 +36,7 @@ export class AbstractViewNext {
|
|||
* @returns {void}
|
||||
*/
|
||||
registerPopupKeyDown() {
|
||||
$win.on('keydown', (event) => {
|
||||
window.addEventListener('keydown', (event) => {
|
||||
if (event && this.modalVisibility && this.modalVisibility()) {
|
||||
if (!this.bDisabeCloseOnEsc && EventKeyCode.Esc === event.keyCode) {
|
||||
delegateRun(this, 'cancelCommand');
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import crossroads from 'crossroads';
|
|||
|
||||
import { Magics } from 'Common/Enums';
|
||||
import { runHook } from 'Common/Plugins';
|
||||
import { $html, VIEW_MODELS, popupVisibilityNames } from 'Common/Globals';
|
||||
import { $htmlCL, VIEW_MODELS, popupVisibilityNames } from 'Common/Globals';
|
||||
|
||||
import { isArray, isUnd, pString, log, isFunc, createCommandLegacy, delegateRun, isNonEmptyArray } from 'Common/Utils';
|
||||
|
||||
|
|
@ -432,8 +432,11 @@ export function startScreens(screensClasses) {
|
|||
hasher.changed.add(cross.parse, cross);
|
||||
hasher.init();
|
||||
|
||||
_.delay(() => $html.removeClass('rl-started-trigger').addClass('rl-started'), 100);
|
||||
_.delay(() => $html.addClass('rl-started-delay'), 200);
|
||||
_.delay(() => {
|
||||
$htmlCL.remove('rl-started-trigger');
|
||||
$htmlCL.add('rl-started');
|
||||
}, 100);
|
||||
_.delay(() => $htmlCL.add('rl-started-delay'), 200);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue