theme: avoid non-styling if user wants to use unsupported theme #178

This commit is contained in:
Sören Weber 2022-02-13 12:48:38 +01:00
parent 0c261fb314
commit 8385ea78b4
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589

View file

@ -35,7 +35,15 @@
}
select.value = theme;
}
function changeTheme( theme, noanimation ){
function changeTheme( theme ){
{{- $quotedthemevariants := slice }}
{{- range $themevariants }}
{{- $quotedthemevariants = $quotedthemevariants | append (printf "\"%s\"" .) }}
{{- end }}
var themes = [ {{ delimit $quotedthemevariants ", " | safeJS }} ];
if( !themes.find( function(e){ return e==theme; } ) ){
theme = themes.length ? themes[ 0 ] : null;
}
if( !theme ){
return;
}