mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
Framework WIP:
- better non-application tab initial loading
This commit is contained in:
parent
2da2ad2faa
commit
dddf1db7bc
@ -268,10 +268,21 @@ export class EgwFramework extends LitElement
|
|||||||
// Wait until new tab is there to activate it
|
// Wait until new tab is there to activate it
|
||||||
if(active || app.active)
|
if(active || app.active)
|
||||||
{
|
{
|
||||||
|
// Wait for egw
|
||||||
|
this.getEgwComplete().then(() =>
|
||||||
|
{
|
||||||
|
// Wait for redraw after getEgwComplete promise
|
||||||
this.updateComplete.then(() =>
|
this.updateComplete.then(() =>
|
||||||
{
|
{
|
||||||
|
// Tabs present
|
||||||
|
this.updateComplete.then(() =>
|
||||||
|
{
|
||||||
|
this.querySelectorAll("egw-app[active]").forEach(n => n.removeAttribute("active"));
|
||||||
|
|
||||||
this.tabs.show(appname);
|
this.tabs.show(appname);
|
||||||
})
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return appComponent;
|
return appComponent;
|
||||||
@ -513,7 +524,11 @@ export class EgwFramework extends LitElement
|
|||||||
appComponent.setAttribute("active", "");
|
appComponent.setAttribute("active", "");
|
||||||
|
|
||||||
// Update the list on the server
|
// Update the list on the server
|
||||||
this.updateTabs(event.target.activeTab);
|
const tabGroup : SlTabGroup = this.shadowRoot.querySelector("sl-tab-group.egw_fw__open_applications");
|
||||||
|
tabGroup.updateComplete.then(() =>
|
||||||
|
{
|
||||||
|
this.updateTabs(appComponent);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -533,7 +548,10 @@ export class EgwFramework extends LitElement
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Show will update, but closing in the background we call directly
|
// Show will update, but closing in the background we call directly
|
||||||
|
tabGroup.updateComplete.then(() =>
|
||||||
|
{
|
||||||
this.updateTabs(tabGroup.querySelector("sl-tab[active]"));
|
this.updateTabs(tabGroup.querySelector("sl-tab[active]"));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the tab + panel
|
// Remove the tab + panel
|
||||||
@ -554,6 +572,19 @@ export class EgwFramework extends LitElement
|
|||||||
//Send the current tab list to the server
|
//Send the current tab list to the server
|
||||||
let data = this.assembleTabList(activeTab);
|
let data = this.assembleTabList(activeTab);
|
||||||
|
|
||||||
|
// Update session tabs
|
||||||
|
let tabs = {};
|
||||||
|
Object.keys(this.tabApps).forEach((t) =>
|
||||||
|
{
|
||||||
|
if(data.some(d => d.appName == t))
|
||||||
|
{
|
||||||
|
tabs[t] = this.tabApps[t];
|
||||||
|
tabs[t].active = t == activeTab.id;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.tabApps = tabs;
|
||||||
|
|
||||||
|
|
||||||
//Serialize the tab list and check whether it really has changed since the last
|
//Serialize the tab list and check whether it really has changed since the last
|
||||||
//submit
|
//submit
|
||||||
var serialized = egw.jsonEncode(data);
|
var serialized = egw.jsonEncode(data);
|
||||||
@ -573,7 +604,7 @@ export class EgwFramework extends LitElement
|
|||||||
let appList = []
|
let appList = []
|
||||||
Array.from(this.shadowRoot.querySelectorAll("sl-tab-group.egw_fw__open_applications sl-tab")).forEach((tab : SlTab) =>
|
Array.from(this.shadowRoot.querySelectorAll("sl-tab-group.egw_fw__open_applications sl-tab")).forEach((tab : SlTab) =>
|
||||||
{
|
{
|
||||||
appList.push({appName: tab.panel, active: activeTab.panel == tab.panel})
|
appList.push({appName: tab.panel, active: activeTab.id == tab.panel})
|
||||||
});
|
});
|
||||||
return appList;
|
return appList;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user