mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +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
|
|
@ -1,4 +1,3 @@
|
|||
import _ from '_';
|
||||
import ko from 'ko';
|
||||
|
||||
import { Magics } from 'Common/Enums';
|
||||
|
|
@ -41,7 +40,7 @@ class BrandingAdminSettings {
|
|||
}
|
||||
|
||||
onBuild() {
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
const f1 = settingsSaveHelperSimpleFunction(this.title.trigger, this),
|
||||
f2 = settingsSaveHelperSimpleFunction(this.loadingDesc.trigger, this),
|
||||
f3 = settingsSaveHelperSimpleFunction(this.faviconUrl.trigger, this);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import _ from '_';
|
||||
import ko from 'ko';
|
||||
|
||||
import { settingsSaveHelperSimpleFunction, defautOptionsAfterRender, trim, boolToAjax } from 'Common/Utils';
|
||||
|
|
@ -144,7 +143,7 @@ class ContactsAdminSettings {
|
|||
}
|
||||
|
||||
onBuild() {
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
const f1 = settingsSaveHelperSimpleFunction(this.pdoDsnTrigger, this),
|
||||
f3 = settingsSaveHelperSimpleFunction(this.pdoUserTrigger, this),
|
||||
f4 = settingsSaveHelperSimpleFunction(this.pdoPasswordTrigger, this),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import _ from '_';
|
||||
import ko from 'ko';
|
||||
|
||||
import {
|
||||
|
|
@ -76,13 +75,13 @@ class GeneralAdminSettings {
|
|||
}
|
||||
|
||||
onBuild() {
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
const f1 = settingsSaveHelperSimpleFunction(this.attachmentLimitTrigger, this),
|
||||
f2 = settingsSaveHelperSimpleFunction(this.languageTrigger, this),
|
||||
f3 = settingsSaveHelperSimpleFunction(this.themeTrigger, this),
|
||||
fReloadLanguageHelper = (saveSettingsStep) => () => {
|
||||
this.languageAdminTrigger(saveSettingsStep);
|
||||
_.delay(() => this.languageAdminTrigger(SaveSettingsStep.Idle), Magics.Time1s);
|
||||
setTimeout(() => this.languageAdminTrigger(SaveSettingsStep.Idle), Magics.Time1s);
|
||||
};
|
||||
|
||||
this.mainAttachmentLimit.subscribe((value) => {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import _ from '_';
|
||||
import ko from 'ko';
|
||||
|
||||
import { settingsSaveHelperSimpleFunction, boolToAjax, trim } from 'Common/Utils';
|
||||
|
|
@ -20,7 +19,7 @@ class LoginAdminSettings {
|
|||
}
|
||||
|
||||
onBuild() {
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
const f1 = settingsSaveHelperSimpleFunction(this.defaultDomain.trigger, this);
|
||||
|
||||
this.determineUserLanguage.subscribe((value) => {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import _ from '_';
|
||||
import { settingsSaveHelperSimpleFunction, trim } from 'Common/Utils';
|
||||
import { Magics } from 'Common/Enums';
|
||||
|
||||
|
|
@ -11,7 +10,7 @@ class BrandingPremAdminSettings extends BrandingAdminSettings {
|
|||
super.onBuild(dom);
|
||||
|
||||
if (this.capa && this.capa() && !this.community) {
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
const f1 = settingsSaveHelperSimpleFunction(this.loginLogo.trigger, this),
|
||||
f2 = settingsSaveHelperSimpleFunction(this.loginDescription.trigger, this),
|
||||
f3 = settingsSaveHelperSimpleFunction(this.loginCss.trigger, this),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import _ from '_';
|
||||
import ko from 'ko';
|
||||
|
||||
import { trim, boolToAjax } from 'Common/Utils';
|
||||
|
|
@ -105,7 +104,7 @@ class SecurityAdminSettings {
|
|||
this.twoFactorDropperUser('');
|
||||
this.isTwoFactorDropperShown(true);
|
||||
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
this.twoFactorDropperUser.focused(true);
|
||||
}, Magics.Time50ms);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import _ from '_';
|
||||
import ko from 'ko';
|
||||
|
||||
import { MESSAGES_PER_PAGE_VALUES } from 'Common/Consts';
|
||||
|
|
@ -96,13 +95,13 @@ class GeneralUserSettings {
|
|||
}
|
||||
|
||||
onBuild() {
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
const f0 = settingsSaveHelperSimpleFunction(this.editorDefaultTypeTrigger, this),
|
||||
f1 = settingsSaveHelperSimpleFunction(this.mppTrigger, this),
|
||||
f2 = settingsSaveHelperSimpleFunction(this.layoutTrigger, this),
|
||||
fReloadLanguageHelper = (saveSettingsStep) => () => {
|
||||
this.languageTrigger(saveSettingsStep);
|
||||
_.delay(() => this.languageTrigger(SaveSettingsStep.Idle), Magics.Time1s);
|
||||
setTimeout(() => this.languageTrigger(SaveSettingsStep.Idle), Magics.Time1s);
|
||||
};
|
||||
|
||||
this.language.subscribe((value) => {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import _ from '_';
|
||||
import ko from 'ko';
|
||||
|
||||
import { delegateRunOnDestroy, boolToAjax } from 'Common/Utils';
|
||||
|
|
@ -66,7 +65,7 @@ class OpenPgpUserSettings {
|
|||
}
|
||||
|
||||
onBuild() {
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
this.allowDraftAutosave.subscribe(Remote.saveSettingsHelper('AllowDraftAutosave', boolToAjax));
|
||||
}, Magics.Time50ms);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import _ from '_';
|
||||
import ko from 'ko';
|
||||
|
||||
import { pInt, settingsSaveHelperSimpleFunction } from 'Common/Utils';
|
||||
|
|
@ -42,7 +41,7 @@ class SecurityUserSettings {
|
|||
|
||||
onBuild() {
|
||||
if (this.capaAutoLogout) {
|
||||
_.delay(() => {
|
||||
setTimeout(() => {
|
||||
const f0 = settingsSaveHelperSimpleFunction(this.autoLogout.trigger, this);
|
||||
|
||||
this.autoLogout.subscribe(Remote.saveSettingsHelper('AutoLogout', pInt, f0));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue