mirror of
https://github.com/zombieFox/nightTab.git
synced 2024-12-29 18:18:52 +01:00
29 lines
510 B
JavaScript
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
|
|
};
|
|
|
|
})();
|