Fixed popped panels to display as selected theme.
This commit is contained in:
parent
315c5340f3
commit
86acfa5b7c
3 changed files with 30 additions and 10 deletions
|
|
@ -406,6 +406,9 @@ class poppedPanel{
|
|||
* Fills container window with Popped Panel container elements
|
||||
*/
|
||||
fillContainer(){
|
||||
//Apply theme
|
||||
this.window.document.head.appendChild(ThemeManager.genThemeLink());
|
||||
|
||||
//Set Element Nodes
|
||||
this.panelDiv = this.window.document.querySelector("#cpanel-div");
|
||||
this.panelTitle = this.window.document.querySelector("#cpanel-title");
|
||||
|
|
|
|||
|
|
@ -111,6 +111,16 @@ class settingsPanel extends panelObj{
|
|||
}
|
||||
|
||||
fillThemes(){
|
||||
//Find theme selector
|
||||
const selector = this.theme.querySelector('select');
|
||||
|
||||
//If the theme selector has already been filled or doesnt exist
|
||||
if(selector == null || selector.childElementCount > 0){
|
||||
//Stop while we're ahead
|
||||
return;
|
||||
}
|
||||
|
||||
//For each theme
|
||||
for(let themeName of ThemeManager.themes.keys()){
|
||||
//Create theme option
|
||||
let option = document.createElement('option');
|
||||
|
|
@ -120,7 +130,7 @@ class settingsPanel extends panelObj{
|
|||
option.innerText = themeName;
|
||||
|
||||
//Add option to theme selector
|
||||
this.theme.querySelector('select').appendChild(option);
|
||||
selector.appendChild(option);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue