mirror of
https://github.com/zombieFox/nightTab.git
synced 2024-11-24 09:03:39 +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
|
|
};
|
|
|
|
})();
|