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:
djmaze 2020-07-15 14:25:51 +02:00
parent a6a337e5ce
commit 0b0747b8dc
19 changed files with 142 additions and 151 deletions

View file

@ -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');