mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
Underscore.js _.delay() to native setTimeout()
This commit is contained in:
parent
a82575a830
commit
43c92a82e6
29 changed files with 67 additions and 82 deletions
|
|
@ -508,7 +508,7 @@ class ComposePopupView extends AbstractViewNext {
|
|||
contactsCommand() {
|
||||
if (this.allowContacts) {
|
||||
this.skipCommand();
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
showScreenPopup(require('View/Popup/Contacts'), [true, this.sLastFocusedField]);
|
||||
}, Magics.Time200ms);
|
||||
}
|
||||
|
|
@ -706,7 +706,7 @@ class ComposePopupView extends AbstractViewNext {
|
|||
editor(fOnInit) {
|
||||
if (fOnInit) {
|
||||
if (!this.oEditor && this.composeEditorArea()) {
|
||||
// _.delay(() => {
|
||||
// setTimeout(() => {
|
||||
this.oEditor = new HtmlEditor(
|
||||
this.composeEditorArea(),
|
||||
null,
|
||||
|
|
@ -1169,7 +1169,7 @@ class ComposePopupView extends AbstractViewNext {
|
|||
|
||||
setFocusInPopup() {
|
||||
if (!bMobileDevice) {
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
if ('' === this.to()) {
|
||||
this.to.focused(true);
|
||||
} else if (this.oEditor) {
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ class ComposeOpenPgpPopupView extends AbstractViewNext {
|
|||
}
|
||||
|
||||
if (result && this.resultCallback) {
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
let pgpPromise = null;
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ class ContactsPopupView extends AbstractViewNext {
|
|||
|
||||
this.sLastComposeFocusedField = '';
|
||||
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
showScreenPopup(require('View/Popup/Compose'), [ComposeType.Empty, null, toEmails, ccEmails, bccEmails]);
|
||||
}, Magics.Time200ms);
|
||||
}
|
||||
|
|
@ -327,14 +327,14 @@ class ContactsPopupView extends AbstractViewNext {
|
|||
res = true;
|
||||
}
|
||||
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
this.viewSaveTrigger(res ? SaveSettingsStep.TrueResult : SaveSettingsStep.FalseResult);
|
||||
}, Magics.Time350ms);
|
||||
|
||||
if (res) {
|
||||
this.watchDirty(false);
|
||||
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
this.viewSaveTrigger(SaveSettingsStep.Idle);
|
||||
}, Magics.Time1s);
|
||||
}
|
||||
|
|
@ -470,7 +470,7 @@ class ContactsPopupView extends AbstractViewNext {
|
|||
this.bDropPageAfterDelete = true;
|
||||
}
|
||||
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
contacts.forEach(contact => {
|
||||
koContacts.remove(contact);
|
||||
delegateRunOnDestroy(contact);
|
||||
|
|
@ -495,7 +495,7 @@ class ContactsPopupView extends AbstractViewNext {
|
|||
if (Magics.Time500ms < (StorageResultType.Success === sResult && oData && oData.Time ? pInt(oData.Time) : 0)) {
|
||||
this.reloadContactList(this.bDropPageAfterDelete);
|
||||
} else {
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
this.reloadContactList(this.bDropPageAfterDelete);
|
||||
}, Magics.Time500ms);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import _ from '_';
|
||||
import ko from 'ko';
|
||||
import key from 'key';
|
||||
import $ from '$';
|
||||
|
|
@ -37,7 +36,7 @@ class MessageOpenPgpPopupView extends AbstractViewNext {
|
|||
doCommand() {
|
||||
this.submitRequest(true);
|
||||
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
let privateKey = null;
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import _ from '_';
|
||||
import ko from 'ko';
|
||||
|
||||
import { Magics } from 'Common/Enums';
|
||||
|
|
@ -53,7 +52,7 @@ class NewOpenPgpKeyPopupView extends AbstractViewNext {
|
|||
this.submitRequest(true);
|
||||
this.submitError('');
|
||||
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
try {
|
||||
PgpStore.openpgp
|
||||
.generateKey({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue