mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
fix: reinitialize settings tabs for DOM events
This commit is contained in:
parent
856688f884
commit
16b9f09e66
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user