Fix theme change if no file tree is shown
This commit is contained in:
@ -422,9 +422,13 @@ var CodeOceanEditor = {
|
|||||||
this.toggleButtonStates();
|
this.toggleButtonStates();
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
$(document).on('theme:change', function(event) {
|
$(document).on('theme:change', function(event) {
|
||||||
const newColorScheme = event.detail.currentTheme;
|
const jsTree = filesInstance?.jstree(true);
|
||||||
// Update the JStree theme
|
|
||||||
filesInstance.jstree(true).set_theme(newColorScheme === "dark" ? "default-dark" : "default");
|
if (jsTree) {
|
||||||
|
const newColorScheme = event.detail.currentTheme;
|
||||||
|
// Update the JStree theme
|
||||||
|
jsTree?.set_theme(newColorScheme === "dark" ? "default-dark" : "default");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user