mirror of
https://github.com/zombieFox/nightTab.git
synced 2025-03-14 14:48:13 +01:00
[refactor] improve theme preset get
This commit is contained in:
parent
f0cfe94003
commit
484ea71acc
@ -109,37 +109,36 @@ var theme = (function() {
|
||||
|
||||
mod.preset = {
|
||||
set: function(name) {
|
||||
var selectedPreset = mod.preset.get(name);
|
||||
helper.setObject({
|
||||
object: state.get.current(),
|
||||
path: "theme.style",
|
||||
newValue: mod.preset.all[name].style
|
||||
newValue: selectedPreset.style
|
||||
});
|
||||
helper.setObject({
|
||||
object: state.get.current(),
|
||||
path: "theme.font.display",
|
||||
newValue: mod.preset.all[name].font.display
|
||||
});
|
||||
helper.setObject({
|
||||
object: state.get.current(),
|
||||
path: "theme.font.ui",
|
||||
newValue: mod.preset.all[name].font.ui
|
||||
path: "theme.font",
|
||||
newValue: selectedPreset.font
|
||||
});
|
||||
helper.setObject({
|
||||
object: state.get.current(),
|
||||
path: "theme.color",
|
||||
newValue: mod.preset.all[name].color
|
||||
newValue: selectedPreset.color
|
||||
});
|
||||
helper.setObject({
|
||||
object: state.get.current(),
|
||||
path: "theme.accent.current",
|
||||
newValue: mod.preset.all[name].accent
|
||||
newValue: selectedPreset.accent
|
||||
});
|
||||
helper.setObject({
|
||||
object: state.get.current(),
|
||||
path: "theme.radius",
|
||||
newValue: mod.preset.all[name].radius
|
||||
newValue: selectedPreset.radius
|
||||
});
|
||||
},
|
||||
get: function(name) {
|
||||
return JSON.parse(JSON.stringify(mod.preset.all[name]));
|
||||
},
|
||||
all: {
|
||||
nighttab: {
|
||||
font: {
|
||||
|
Loading…
Reference in New Issue
Block a user