mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-24 01:44:44 +00:00
theme edit: ensure that the saved theme is actually valid
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
745aeaacdd
commit
5835bc4c10
@ -4,14 +4,17 @@ Ext.define('Proxmox.window.ThemeEditWindow', {
|
|||||||
|
|
||||||
viewModel: {
|
viewModel: {
|
||||||
parent: null,
|
parent: null,
|
||||||
data: {
|
data: {},
|
||||||
language: '__default__',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
controller: {
|
controller: {
|
||||||
xclass: 'Ext.app.ViewController',
|
xclass: 'Ext.app.ViewController',
|
||||||
init: function(view) {
|
init: function(view) {
|
||||||
let theme = Ext.util.Cookies.get(view.cookieName) || '__default__';
|
let theme = '__default__';
|
||||||
|
|
||||||
|
let savedTheme = Ext.util.Cookies.get(view.cookieName);
|
||||||
|
if (savedTheme && savedTheme in Proxmox.Utils.theme_map) {
|
||||||
|
theme = savedTheme;
|
||||||
|
}
|
||||||
this.getViewModel().set('theme', theme);
|
this.getViewModel().set('theme', theme);
|
||||||
},
|
},
|
||||||
applyTheme: function(button) {
|
applyTheme: function(button) {
|
||||||
|
Loading…
Reference in New Issue
Block a user