mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-09 00:08:18 +08:00
ea48f5060b
isUnd(*) to native undefined === * isFunc to native typeof * === 'function' isObject to native typeof * === 'object' microtime() to native Date().getTime(); noop to native ()=>{} noopFalse to native ()=>false noopTrue to native ()=>true boolToAjax to native *?'1':'0' Underscore.js to native
23 lines
663 B
JavaScript
23 lines
663 B
JavaScript
import ko from 'ko';
|
|
import * as Settings from 'Storage/Settings';
|
|
|
|
class ThemeStore {
|
|
constructor() {
|
|
this.themes = ko.observableArray([]);
|
|
this.themeBackgroundName = ko.observable('');
|
|
this.themeBackgroundHash = ko.observable('');
|
|
|
|
this.theme = ko.observable('').extend({ limitedList: this.themes });
|
|
}
|
|
|
|
populate() {
|
|
const themes = Settings.appSettingsGet('themes');
|
|
|
|
this.themes(Array.isArray(themes) ? themes : []);
|
|
this.theme(Settings.settingsGet('Theme'));
|
|
this.themeBackgroundName(Settings.settingsGet('UserBackgroundName'));
|
|
this.themeBackgroundHash(Settings.settingsGet('UserBackgroundHash'));
|
|
}
|
|
}
|
|
|
|
export default new ThemeStore();
|