|
@@ -495,7 +495,7 @@ export const JSONToLayout = (app: App, isStart: boolean) => {
|
|
zoomIn: idZoomIn.isZoomIn
|
|
zoomIn: idZoomIn.isZoomIn
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- let latestTabHeaderElement:HTMLElement;
|
|
|
|
|
|
+ let latestTabHeaderElement: HTMLElement;
|
|
document.querySelectorAll('li[data-type="tab-header"][data-init-active="true"]').forEach((item: HTMLElement) => {
|
|
document.querySelectorAll('li[data-type="tab-header"][data-init-active="true"]').forEach((item: HTMLElement) => {
|
|
if (!latestTabHeaderElement) {
|
|
if (!latestTabHeaderElement) {
|
|
latestTabHeaderElement = item;
|
|
latestTabHeaderElement = item;
|
|
@@ -779,7 +779,7 @@ export const addResize = (obj: Layout | Wnd) => {
|
|
}
|
|
}
|
|
|
|
|
|
const getMinSize = (element: HTMLElement) => {
|
|
const getMinSize = (element: HTMLElement) => {
|
|
- let minSize = 227;
|
|
|
|
|
|
+ let minSize = 232;
|
|
Array.from(element.querySelectorAll(".file-tree")).find((item) => {
|
|
Array.from(element.querySelectorAll(".file-tree")).find((item) => {
|
|
if (item.classList.contains("sy__backlink") || item.classList.contains("sy__graph")
|
|
if (item.classList.contains("sy__backlink") || item.classList.contains("sy__graph")
|
|
|| item.classList.contains("sy__globalGraph") || item.classList.contains("sy__inbox")) {
|
|
|| item.classList.contains("sy__globalGraph") || item.classList.contains("sy__inbox")) {
|
|
@@ -791,6 +791,7 @@ export const addResize = (obj: Layout | Wnd) => {
|
|
});
|
|
});
|
|
return minSize;
|
|
return minSize;
|
|
};
|
|
};
|
|
|
|
+
|
|
const resizeWnd = (resizeElement: HTMLElement, direction: string) => {
|
|
const resizeWnd = (resizeElement: HTMLElement, direction: string) => {
|
|
const setSize = (item: HTMLElement, direction: string) => {
|
|
const setSize = (item: HTMLElement, direction: string) => {
|
|
if (item.classList.contains("fn__flex-1")) {
|
|
if (item.classList.contains("fn__flex-1")) {
|
|
@@ -901,6 +902,62 @@ export const addResize = (obj: Layout | Wnd) => {
|
|
resizeElement.classList.add("layout__resize");
|
|
resizeElement.classList.add("layout__resize");
|
|
obj.element.insertAdjacentElement("beforebegin", resizeElement);
|
|
obj.element.insertAdjacentElement("beforebegin", resizeElement);
|
|
resizeWnd(resizeElement, obj.resize);
|
|
resizeWnd(resizeElement, obj.resize);
|
|
|
|
+
|
|
|
|
+ resizeElement.addEventListener("dblclick", () => {
|
|
|
|
+ const previousElement = resizeElement.previousElementSibling as HTMLElement;
|
|
|
|
+ const nextElement = resizeElement.nextElementSibling as HTMLElement;
|
|
|
|
+ if (previousElement && nextElement) {
|
|
|
|
+ const bigType = ["graph", "inbox", "globalGraph", "backlink"]
|
|
|
|
+ let size = 232
|
|
|
|
+ nextElement.style.transition = "none";
|
|
|
|
+ previousElement.style.transition = "none";
|
|
|
|
+ if (resizeElement.classList.contains("layout__resize--lr")) {
|
|
|
|
+ if (previousElement.classList.contains("layout__dockl")) {
|
|
|
|
+ document.querySelectorAll("#dockLeft .dock__item--active").forEach(item => {
|
|
|
|
+ if (bigType.includes(item.getAttribute("data-type"))) {
|
|
|
|
+ size = 320
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ previousElement.style.width = size + 'px'
|
|
|
|
+ window.siyuan.layout.leftDock.setSize();
|
|
|
|
+ } else if (nextElement.classList.contains("layout__dockr")) {
|
|
|
|
+ document.querySelectorAll("#dockRight .dock__item--active").forEach(item => {
|
|
|
|
+ if (bigType.includes(item.getAttribute("data-type"))) {
|
|
|
|
+ size = 320
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ nextElement.style.width = size + 'px'
|
|
|
|
+ window.siyuan.layout.rightDock.setSize();
|
|
|
|
+ } else {
|
|
|
|
+ previousElement.style.width = ''
|
|
|
|
+ nextElement.style.width = ''
|
|
|
|
+ previousElement.classList.add("fn__flex-1")
|
|
|
|
+ nextElement.classList.add("fn__flex-1")
|
|
|
|
+ if (resizeElement.parentElement.classList.contains("layout__dockb")) {
|
|
|
|
+ window.siyuan.layout.bottomDock.setSize();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (nextElement.classList.contains("layout__dockb")) {
|
|
|
|
+ nextElement.style.height = '232px'
|
|
|
|
+ window.siyuan.layout.bottomDock.setSize();
|
|
|
|
+ } else {
|
|
|
|
+ previousElement.style.height = ''
|
|
|
|
+ nextElement.style.height = ''
|
|
|
|
+ previousElement.classList.add("fn__flex-1")
|
|
|
|
+ nextElement.classList.add("fn__flex-1")
|
|
|
|
+ if (resizeElement.parentElement.classList.contains("layout__dockl")) {
|
|
|
|
+ window.siyuan.layout.leftDock.setSize();
|
|
|
|
+ } else if (resizeElement.parentElement.classList.contains("layout__dockr")) {
|
|
|
|
+ window.siyuan.layout.rightDock.setSize();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ resizeTabs();
|
|
|
|
+ nextElement.style.transition = "";
|
|
|
|
+ previousElement.style.transition = "";
|
|
|
|
+ }
|
|
|
|
+ });
|
|
};
|
|
};
|
|
|
|
|
|
export const adjustLayout = (layout: Layout = window.siyuan.layout.centerLayout.parent) => {
|
|
export const adjustLayout = (layout: Layout = window.siyuan.layout.centerLayout.parent) => {
|