mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +03:00
isArray to native Array.isArray
isUnd(*) to native undefined === *
isFunc to native typeof * === 'function'
isObject to native typeof * === 'object'
microtime() to native Date().getTime();
noop to native ()=>{}
noopFalse to native ()=>false
noopTrue to native ()=>true
boolToAjax to native *?'1':'0'
Underscore.js to native
This commit is contained in:
parent
fa39c7ecba
commit
ea48f5060b
72 changed files with 551 additions and 775 deletions
29
dev/bootstrap.js
vendored
29
dev/bootstrap.js
vendored
|
|
@ -1,5 +1,5 @@
|
|||
import window from 'window';
|
||||
import { killCtrlACtrlS, detectDropdownVisibility, createCommandLegacy, domReady } from 'Common/Utils';
|
||||
import { detectDropdownVisibility, createCommandLegacy, domReady } from 'Common/Utils';
|
||||
import { $html, $htmlCL, data as GlobalsData, bMobileDevice } from 'Common/Globals';
|
||||
import * as Enums from 'Common/Enums';
|
||||
import * as Plugins from 'Common/Plugins';
|
||||
|
|
@ -9,7 +9,32 @@ import { EmailModel } from 'Model/Email';
|
|||
export default (App) => {
|
||||
GlobalsData.__APP__ = App;
|
||||
|
||||
window.addEventListener('keydown', killCtrlACtrlS);
|
||||
window.addEventListener('keydown', event => {
|
||||
event = event || window.event;
|
||||
if (event && event.ctrlKey && !event.shiftKey && !event.altKey) {
|
||||
const key = event.keyCode || event.which;
|
||||
if (key === Enums.EventKeyCode.S) {
|
||||
event.preventDefault();
|
||||
return;
|
||||
} else if (key === Enums.EventKeyCode.A) {
|
||||
const sender = event.target || event.srcElement;
|
||||
if (
|
||||
sender &&
|
||||
('true' === '' + sender.contentEditable || (sender.tagName && sender.tagName.match(/INPUT|TEXTAREA/i)))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (window.getSelection) {
|
||||
window.getSelection().removeAllRanges();
|
||||
} else if (window.document.selection && window.document.selection.clear) {
|
||||
window.document.selection.clear();
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
window.addEventListener('unload', () => {
|
||||
GlobalsData.bUnload = true;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue