nightTab/js/theme.js

29 lines
510 B
JavaScript
Raw Normal View History

2018-12-26 08:45:53 +01:00
var theme = (function() {
2019-04-01 17:11:39 +02: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 15:42:14 +01:00
};
2019-04-01 17:11:39 +02:00
style[state.get().theme.style]();
2018-12-26 08:45:53 +01:00
};
// exposed methods
return {
2019-04-01 17:11:39 +02:00
toggle: toggle
2018-12-26 08:45:53 +01:00
};
})();