theme system updated
This commit is contained in:
1 parent
369845f601
commit
da3ea2173a
4 files changed
+126
-62
No files matched your search
@@ -4,35 +4,9 @@ export default function (app) {
|
||||
app.component('accessibilityControl', {
|
||||
template,
|
||||
controller: ($scope, theme) => {
|
||||
const themeSet = {
|
||||
accessibility: 'accessibility',
|
||||
color: '',
|
||||
fontSize: '',
|
||||
fontFamily: '',
|
||||
}
|
||||
|
||||
const install = () => {
|
||||
const baked = Object
|
||||
.values(themeSet)
|
||||
.filter(Boolean)
|
||||
.join(' ')
|
||||
theme.setTheme(baked)
|
||||
}
|
||||
|
||||
$scope.setColorTheme = (color) => {
|
||||
themeSet.color = color
|
||||
install()
|
||||
}
|
||||
|
||||
$scope.setFontTheme = (font) => {
|
||||
themeSet.fontSize = font
|
||||
install()
|
||||
}
|
||||
|
||||
$scope.setFontFamilyTheme = (font) => {
|
||||
themeSet.fontFamily = font
|
||||
install()
|
||||
}
|
||||
$scope.setColorTheme = theme.setColorTheme.bind(theme)
|
||||
$scope.setFontTheme = theme.setFontTheme.bind(theme)
|
||||
$scope.setFontFamilyTheme = theme.setFontFamilyTheme.bind(theme)
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user