nightTab/js/theme.js
2019-04-01 16:11:39 +01:00

29 lines
510 B
JavaScript

var theme = (function() {
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"
})
}
};
style[state.get().theme.style]();
};
// exposed methods
return {
toggle: toggle
};
})();