This commit is contained in:
Vanessa 2023-11-13 09:54:13 +08:00
parent 70bf7c1b9a
commit 24f43654bd

View file

@ -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();
}
});
};
});