snappymail/dev/Stores/Theme.js
RainLoop Team e5af98b04b Update ckeditor
Move e2e tests
Code refactoring
2016-09-12 23:50:21 +03:00

27 lines
694 B
JavaScript

import ko from 'ko';
import {isArray} from 'Common/Utils';
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(isArray(themes) ? themes : []);
this.theme(Settings.settingsGet('Theme'));
this.themeBackgroundName(Settings.settingsGet('UserBackgroundName'));
this.themeBackgroundHash(Settings.settingsGet('UserBackgroundHash'));
}
}
export default new ThemeStore();