This commit is contained in:
parent
70bf7c1b9a
commit
24f43654bd
1 changed files with 9 additions and 3 deletions
|
@ -44,19 +44,19 @@ export class Dock {
|
|||
this.layout = window.siyuan.layout.layout.children[0].children[0] as Layout;
|
||||
this.resizeElement = this.layout.element.nextElementSibling as HTMLElement;
|
||||
this.layout.element.classList.add("layout__dockl");
|
||||
this.layout.element.insertAdjacentHTML("beforeend", "<div class=\"layout__dockresize layout__dockresize--lr\"></div>");
|
||||
this.layout.element.insertAdjacentHTML("beforeend", '<div class="layout__dockresize layout__dockresize--lr"></div>');
|
||||
break;
|
||||
case "Right":
|
||||
this.layout = window.siyuan.layout.layout.children[0].children[2] as Layout;
|
||||
this.resizeElement = this.layout.element.previousElementSibling as HTMLElement;
|
||||
this.layout.element.classList.add("layout__dockr");
|
||||
this.layout.element.insertAdjacentHTML("beforeend", "<div class=\"layout__dockresize layout__dockresize--lr\"></div>");
|
||||
this.layout.element.insertAdjacentHTML("beforeend", '<div class="layout__dockresize layout__dockresize--lr"></div>');
|
||||
break;
|
||||
case "Bottom":
|
||||
this.layout = window.siyuan.layout.layout.children[1] as Layout;
|
||||
this.resizeElement = this.layout.element.previousElementSibling as HTMLElement;
|
||||
this.layout.element.classList.add("layout__dockb");
|
||||
this.layout.element.insertAdjacentHTML("beforeend", "<div class=\"layout__dockresize\"></div>");
|
||||
this.layout.element.insertAdjacentHTML("beforeend", '<div class="layout__dockresize"></div>');
|
||||
break;
|
||||
}
|
||||
this.app = options.app;
|
||||
|
@ -189,6 +189,12 @@ export class Dock {
|
|||
documentSelf.onselectstart = null;
|
||||
documentSelf.onselect = null;
|
||||
this.setSize();
|
||||
this.element.querySelectorAll(".dock__item--active").forEach(item => {
|
||||
const customModel = this.data[item.getAttribute("data-type")]
|
||||
if (customModel && customModel instanceof Custom && customModel.resize) {
|
||||
customModel.resize();
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue