Framework WIP:

- Resize etemplates when sidebar resizes
This commit is contained in:
nathan 2024-06-10 11:31:47 -06:00
parent 4488287caf
commit 2da2ad2faa

View File

@ -319,9 +319,9 @@ export class EgwFrameworkApp extends LitElement
this.egw.loading_prompt(this.name, true, this.egw.lang('please wait...'), this, egwIsMobile() ? 'horizental' : 'spinner'); this.egw.loading_prompt(this.name, true, this.egw.lang('please wait...'), this, egwIsMobile() ? 'horizental' : 'spinner');
// Give framework a chance to deal, then reset the etemplates // Give framework a chance to deal, then reset the etemplates
appWindow.setTimeout(function() appWindow.setTimeout(() =>
{ {
for(var i = 0; i < et2_list.length; i++) for(let i = 0; i < et2_list.length; i++)
{ {
et2_list[i].widgetContainer.iterateOver(function(_widget) et2_list[i].widgetContainer.iterateOver(function(_widget)
{ {
@ -449,9 +449,18 @@ export class EgwFrameworkApp extends LitElement
{ {
window.clearTimeout(this.resizeTimeout); window.clearTimeout(this.resizeTimeout);
} }
window.setTimeout(() => this.resizeTimeout = window.setTimeout(() =>
{ {
this.egw.set_preference(this.name, preferenceName, newPosition); this.egw.set_preference(this.name, preferenceName, newPosition);
// Tell etemplates to resize
this.querySelectorAll("[id]").forEach(e =>
{
if(etemplate2.getById(e.id))
{
etemplate2.getById(e.id).resize(new Event("resize"));
}
});
}, 500); }, 500);
} }
} }