|
@@ -42,7 +42,12 @@ export class PanelManager {
|
|
|
|
|
|
|
|
const sameKeyPanels = this.getPanels(area).filter((p) => p.key === key);
|
|
const sameKeyPanels = this.getPanels(area).filter((p) => p.key === key);
|
|
|
if (!factory.allowDuplicates && sameKeyPanels.length) {
|
|
if (!factory.allowDuplicates && sameKeyPanels.length) {
|
|
|
- sameKeyPanels.forEach((p) => this.remove(p.id));
|
|
|
|
|
|
|
+ !factory.keepDOM && sameKeyPanels.forEach((p) => this.remove(p.id));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (factory.keepDOM && sameKeyPanels.length) {
|
|
|
|
|
+ sameKeyPanels[0].visible = true;
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const panel = this.createPanel({
|
|
const panel = this.createPanel({
|
|
@@ -62,12 +67,19 @@ export class PanelManager {
|
|
|
public close(key?: string) {
|
|
public close(key?: string) {
|
|
|
const panels = this.getPanels();
|
|
const panels = this.getPanels();
|
|
|
const closedPanels = key ? panels.filter((p) => p.key === key) : panels;
|
|
const closedPanels = key ? panels.filter((p) => p.key === key) : panels;
|
|
|
- closedPanels.forEach((p) => this.remove(p.id));
|
|
|
|
|
|
|
+ closedPanels.forEach((panel) => {
|
|
|
|
|
+ if (panel.keepDOM) {
|
|
|
|
|
+ panel.visible = false;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.remove(panel.id)
|
|
|
|
|
+ });
|
|
|
this.onPanelsChangeEvent.fire();
|
|
this.onPanelsChangeEvent.fire();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private trim(area: Area) {
|
|
private trim(area: Area) {
|
|
|
- const panels = this.getPanels(area);
|
|
|
|
|
|
|
+ const panels = this.getPanels(area).filter((p) => !p.keepDOM);
|
|
|
const areaConfig = this.getAreaConfig(area);
|
|
const areaConfig = this.getAreaConfig(area);
|
|
|
while (panels.length > areaConfig.max) {
|
|
while (panels.length > areaConfig.max) {
|
|
|
const removed = panels.shift();
|
|
const removed = panels.shift();
|