mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
Move addObservablesTo, addComputablesTo & addSubscribablesTo to Common/Utils
This commit is contained in:
parent
eda0ee695d
commit
4b6f6b1bfc
18 changed files with 55 additions and 46 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import ko from 'ko';
|
||||
import { SettingsGet } from 'Common/Globals';
|
||||
import { addObservablesTo } from 'Common/Utils';
|
||||
|
||||
export const AccountUserStore = {
|
||||
accounts: ko.observableArray(),
|
||||
|
|
@ -24,7 +25,7 @@ export const AccountUserStore = {
|
|||
}
|
||||
};
|
||||
|
||||
ko.addObservablesTo(AccountUserStore, {
|
||||
addObservablesTo(AccountUserStore, {
|
||||
email: '',
|
||||
parentEmail: '',
|
||||
signature: ''
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import ko from 'ko';
|
|||
import { KeyState } from 'Common/Enums';
|
||||
import { Focused } from 'Common/EnumsUser';
|
||||
import { keyScope, leftPanelDisabled, Settings, SettingsGet } from 'Common/Globals';
|
||||
import { addObservablesTo } from 'Common/Utils';
|
||||
import { ThemeStore } from 'Stores/Theme';
|
||||
|
||||
export const AppUserStore = {
|
||||
|
|
@ -26,7 +27,7 @@ export const AppUserStore = {
|
|||
}
|
||||
};
|
||||
|
||||
ko.addObservablesTo(AppUserStore, {
|
||||
addObservablesTo(AppUserStore, {
|
||||
currentAudio: '',
|
||||
|
||||
focusedState: Focused.None,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import ko from 'ko';
|
||||
import { SettingsGet } from 'Common/Globals';
|
||||
import { addObservablesTo } from 'Common/Utils';
|
||||
|
||||
export const ContactUserStore = ko.observableArray();
|
||||
|
||||
|
|
@ -7,7 +8,7 @@ ContactUserStore.loading = ko.observable(false).extend({ debounce: 200 });
|
|||
ContactUserStore.importing = ko.observable(false).extend({ debounce: 200 });
|
||||
ContactUserStore.syncing = ko.observable(false).extend({ debounce: 200 });
|
||||
|
||||
ko.addObservablesTo(ContactUserStore, {
|
||||
addObservablesTo(ContactUserStore, {
|
||||
allowSync: false,
|
||||
enableSync: false,
|
||||
syncUrl: '',
|
||||
|
|
|
|||
|
|
@ -2,13 +2,14 @@ import ko from 'ko';
|
|||
|
||||
import { FolderType } from 'Common/EnumsUser';
|
||||
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
||||
import { addObservablesTo } from 'Common/Utils';
|
||||
import { folderListOptionsBuilder } from 'Common/UtilsUser';
|
||||
import { getFolderInboxName, getFolderFromCacheList } from 'Common/Cache';
|
||||
import { SettingsGet } from 'Common/Globals';
|
||||
|
||||
export const FolderUserStore = new class {
|
||||
constructor() {
|
||||
ko.addObservablesTo(this, {
|
||||
addObservablesTo(this, {
|
||||
/**
|
||||
* To use "checkable" option in /#/settings/folders
|
||||
* When true, getNextFolderNames only lists system and "checkable" folders
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import ko from 'ko';
|
|||
import { Notification } from 'Common/Enums';
|
||||
import { Focused, MessageSetAction } from 'Common/EnumsUser';
|
||||
import { doc, elementById } from 'Common/Globals';
|
||||
import { pInt, pString } from 'Common/Utils';
|
||||
import { pInt, pString, addObservablesTo } from 'Common/Utils';
|
||||
import { plainToHtml } from 'Common/UtilsUser';
|
||||
|
||||
import {
|
||||
|
|
@ -72,7 +72,7 @@ export const MessageUserStore = new class {
|
|||
|
||||
this.list = ko.observableArray().extend({ debounce: 0 });
|
||||
|
||||
ko.addObservablesTo(this, {
|
||||
addObservablesTo(this, {
|
||||
listCount: 0,
|
||||
listSearch: '',
|
||||
listThreadUid: '',
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import ko from 'ko';
|
|||
|
||||
import { MESSAGES_PER_PAGE_VALUES } from 'Common/Consts';
|
||||
import { Layout, EditorDefaultType } from 'Common/EnumsUser';
|
||||
import { pInt } from 'Common/Utils';
|
||||
import { pInt, addObservablesTo } from 'Common/Utils';
|
||||
import { $htmlCL, SettingsGet } from 'Common/Globals';
|
||||
import { ThemeStore } from 'Stores/Theme';
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ export const SettingsUserStore = new class {
|
|||
|
||||
this.messagesPerPage = ko.observable(20).extend({ limitedList: MESSAGES_PER_PAGE_VALUES });
|
||||
|
||||
ko.addObservablesTo(this, {
|
||||
addObservablesTo(this, {
|
||||
showImages: false,
|
||||
removeColors: false,
|
||||
useCheckboxesInList: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue