2018-12-26 07:45:53 +00:00
|
|
|
var theme = (function() {
|
|
|
|
|
2019-04-01 15:11:39 +00:00
|
|
|
var toggle = function() {
|
|
|
|
var style = {
|
|
|
|
dark: function() {
|
|
|
|
helper.setObject({
|
|
|
|
object: state.get(),
|
|
|
|
path: "theme.style",
|
|
|
|
newValue: "light"
|
|
|
|
})
|
|
|
|
},
|
|
|
|
light: function() {
|
|
|
|
helper.setObject({
|
|
|
|
object: state.get(),
|
|
|
|
path: "theme.style",
|
|
|
|
newValue: "dark"
|
|
|
|
})
|
|
|
|
}
|
2019-01-07 14:42:14 +00:00
|
|
|
};
|
2019-04-01 15:11:39 +00:00
|
|
|
style[state.get().theme.style]();
|
2018-12-26 07:45:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// exposed methods
|
|
|
|
return {
|
2019-04-01 15:11:39 +00:00
|
|
|
toggle: toggle
|
2018-12-26 07:45:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
})();
|