snappymail/dev/Stores/Theme.js

24 lines
609 B
JavaScript
Raw Normal View History

import ko from 'ko';
2019-07-05 03:19:24 +08:00
class ThemeStore {
constructor() {
this.themes = ko.observableArray([]);
this.themeBackgroundName = ko.observable('');
this.themeBackgroundHash = ko.observable('');
2019-07-05 03:19:24 +08:00
this.theme = ko.observable('').extend({ limitedList: this.themes });
}
populate() {
const Settings = rl.settings,
themes = Settings.app('themes');
this.themes(Array.isArray(themes) ? themes : []);
this.theme(Settings.get('Theme'));
this.themeBackgroundName(Settings.get('UserBackgroundName'));
this.themeBackgroundHash(Settings.get('UserBackgroundHash'));
}
2016-06-30 08:02:45 +08:00
}
export default new ThemeStore();