diff --git a/src/gui/src/UI/Settings/UIWindowSettings.js b/src/gui/src/UI/Settings/UIWindowSettings.js index 7c5a50c6..1b30e646 100644 --- a/src/gui/src/UI/Settings/UIWindowSettings.js +++ b/src/gui/src/UI/Settings/UIWindowSettings.js @@ -110,6 +110,9 @@ async function UIWindowSettings(options){ const component = tab.factory(); component.attach(tab_placeholders[i]); } + if ( tab.reinitialize ) { + tab.reinitialize(); + } if ( tab.dom ) { tab_placeholders[i].replaceWith(tab.dom); } diff --git a/src/gui/src/UI/UIElement.js b/src/gui/src/UI/UIElement.js index 3a8b381d..5220622c 100644 --- a/src/gui/src/UI/UIElement.js +++ b/src/gui/src/UI/UIElement.js @@ -93,6 +93,12 @@ export default def(class UIElement extends AdvancedBase { this.make(this); } + reinitialize () { + this.root = document.createElement(this.tagName); + this.make(this); + return this.root; + } + async open_as_window (options = {}) { const placeholder = Placeholder(); console.log('window options?', this.windowOptions); diff --git a/src/gui/src/services/SettingsService.js b/src/gui/src/services/SettingsService.js index 828f3f63..5b28422c 100644 --- a/src/gui/src/services/SettingsService.js +++ b/src/gui/src/services/SettingsService.js @@ -49,7 +49,12 @@ export class SettingsService extends Service { const ui_element = tab; tab = { ...ui_element.as(TSettingsTab).get_metadata(), - dom: ui_element.root, + reinitialize () { + ui_element.reinitialize(); + }, + get dom () { + return ui_element.root; + }, }; } this.#tabs.push(tab);