mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
Enable AbstractViewSettings
This commit is contained in:
parent
92cec80b73
commit
97bc3ef585
20 changed files with 149 additions and 212 deletions
|
|
@ -1,40 +1,10 @@
|
|||
import { SaveSettingsStep } from 'Common/Enums';
|
||||
import { SettingsGet } from 'Common/Globals';
|
||||
import { settingsSaveHelperSimpleFunction } from 'Common/Utils';
|
||||
import { addObservablesTo, addSubscribablesTo } from 'External/ko';
|
||||
import { AbstractViewSettings } from 'Knoin/AbstractViews';
|
||||
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
export class BrandingAdminSettings /*extends AbstractViewSettings*/ {
|
||||
export class BrandingAdminSettings extends AbstractViewSettings {
|
||||
constructor() {
|
||||
addObservablesTo(this, {
|
||||
title: SettingsGet('Title'),
|
||||
loadingDesc: SettingsGet('LoadingDescription'),
|
||||
faviconUrl: SettingsGet('FaviconUrl'),
|
||||
|
||||
titleTrigger: SaveSettingsStep.Idle,
|
||||
loadingDescTrigger: SaveSettingsStep.Idle,
|
||||
faviconUrlTrigger: SaveSettingsStep.Idle
|
||||
});
|
||||
|
||||
addSubscribablesTo(this, {
|
||||
title: (value =>
|
||||
Remote.saveConfig({
|
||||
Title: value.trim()
|
||||
}, settingsSaveHelperSimpleFunction(this.titleTrigger, this))
|
||||
).debounce(999),
|
||||
|
||||
loadingDesc: (value =>
|
||||
Remote.saveConfig({
|
||||
LoadingDescription: value.trim()
|
||||
}, settingsSaveHelperSimpleFunction(this.loadingDescTrigger, this))
|
||||
).debounce(999),
|
||||
|
||||
faviconUrl: (value =>
|
||||
Remote.saveConfig({
|
||||
FaviconUrl: value.trim()
|
||||
}, settingsSaveHelperSimpleFunction(this.faviconUrlTrigger, this))
|
||||
).debounce(999)
|
||||
});
|
||||
super();
|
||||
this.addSetting('Title');
|
||||
this.addSetting('LoadingDescription');
|
||||
this.addSetting('FaviconUrl');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue