diff options
| author | Roger Braun <roger@rogerbraun.net> | 2017-01-17 20:55:53 +0100 |
|---|---|---|
| committer | Roger Braun <roger@rogerbraun.net> | 2017-01-17 20:55:53 +0100 |
| commit | c6f266302f4c75ff99e6dcda83019d1c3eaf73af (patch) | |
| tree | 203c4fb82acbcc202560644df9126789a9668eab /src/components/style_switcher/style_switcher.js | |
| parent | 198eee82bedddf6028cf3fe731a45503039ec24d (diff) | |
| parent | c7a375068d3337144dde85fabf4b4d5a874d70a0 (diff) | |
Merge branch 'develop' into feature/hash-routed
Diffstat (limited to 'src/components/style_switcher/style_switcher.js')
| -rw-r--r-- | src/components/style_switcher/style_switcher.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/components/style_switcher/style_switcher.js b/src/components/style_switcher/style_switcher.js new file mode 100644 index 00000000..8a8cc2a0 --- /dev/null +++ b/src/components/style_switcher/style_switcher.js @@ -0,0 +1,20 @@ +import StyleSetter from '../../services/style_setter/style_setter.js' + +export default { + data: () => ({ + availableStyles: [], + selected: false + }), + created () { + const self = this + window.fetch('/static/css/themes.json') + .then((data) => data.json()) + .then((themes) => { self.availableStyles = themes }) + }, + watch: { + selected () { + const fullPath = `/static/css/${this.selected}` + StyleSetter.setStyle(fullPath) + } + } +} |
