mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 22:17:03 +03:00
Add some comments and some renames
This commit is contained in:
parent
25214f2d87
commit
c14d7bdd46
11 changed files with 74 additions and 27 deletions
|
|
@ -116,6 +116,11 @@ export class AbstractViewSettings
|
|||
onHide() {}
|
||||
viewModelDom
|
||||
*/
|
||||
/**
|
||||
* When this[name] does not exists, create as observable with value of SettingsGet(name)
|
||||
* When this[name+'Trigger'] does not exists, create as observable
|
||||
* Subscribe to this[name], and handle saving the setting
|
||||
*/
|
||||
addSetting(name, valueCb)
|
||||
{
|
||||
let prop = name[0].toLowerCase() + name.slice(1),
|
||||
|
|
@ -131,6 +136,7 @@ export class AbstractViewSettings
|
|||
rl.app.Remote.saveSetting(name, value,
|
||||
iError => {
|
||||
this[trigger](iError ? SaveSettingStatus.Failed : SaveSettingStatus.Success);
|
||||
// iError || Settings.set(name, value);
|
||||
setTimeout(() => this[trigger](SaveSettingStatus.Idle), 1000);
|
||||
}
|
||||
);
|
||||
|
|
@ -138,6 +144,10 @@ export class AbstractViewSettings
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Foreach name if this[name] does not exists, create as observable with value of SettingsGet(name)
|
||||
* Subscribe to this[name], for saving the setting
|
||||
*/
|
||||
addSettings(names)
|
||||
{
|
||||
names.forEach(name => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue