mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-01 10:20:16 +01:00
🎨 Clean code
This commit is contained in:
parent
26984f39df
commit
94d3ccfa9f
12 changed files with 39 additions and 39 deletions
|
|
@ -160,7 +160,7 @@ export const openOutline = async (protyle: IProtyle) => {
|
|||
}
|
||||
}), false, false);
|
||||
newWnd.element.style.width = "200px";
|
||||
newWnd.element.classList.remove("fn__flex-1")
|
||||
newWnd.element.classList.remove("fn__flex-1");
|
||||
switchWnd(newWnd, wnd);
|
||||
fixWndFlex1(newWnd.parent);
|
||||
saveLayout();
|
||||
|
|
|
|||
|
|
@ -910,7 +910,7 @@ export const adjustLayout = (layout: Layout = window.siyuan.layout.centerLayout.
|
|||
|
||||
export const fixWndFlex1 = (layout: Layout) => {
|
||||
if (layout.children.length < 2) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
if (layout.children[layout.children.length - 2].element.classList.contains("fn__flex-1")) {
|
||||
return;
|
||||
|
|
@ -919,27 +919,27 @@ export const fixWndFlex1 = (layout: Layout) => {
|
|||
if (index !== layout.children.length - 2) {
|
||||
if (layout.direction === "lr") {
|
||||
if (item.element.classList.contains("fn__flex-1")) {
|
||||
item.element.style.width = item.element.clientWidth + "px"
|
||||
item.element.classList.remove("fn__flex-1")
|
||||
item.element.style.width = item.element.clientWidth + "px";
|
||||
item.element.classList.remove("fn__flex-1");
|
||||
}
|
||||
} else {
|
||||
if (item.element.classList.contains("fn__flex-1")) {
|
||||
item.element.style.height = item.element.clientHeight + "px"
|
||||
item.element.classList.remove("fn__flex-1")
|
||||
item.element.style.height = item.element.clientHeight + "px";
|
||||
item.element.classList.remove("fn__flex-1");
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
const flex1Element = layout.children[layout.children.length - 2].element
|
||||
});
|
||||
const flex1Element = layout.children[layout.children.length - 2].element;
|
||||
if (layout.direction === "lr") {
|
||||
if (flex1Element.style.width) {
|
||||
flex1Element.style.width = ""
|
||||
flex1Element.classList.add("fn__flex-1")
|
||||
flex1Element.style.width = "";
|
||||
flex1Element.classList.add("fn__flex-1");
|
||||
}
|
||||
} else {
|
||||
if (flex1Element.style.height) {
|
||||
flex1Element.style.height = ""
|
||||
flex1Element.classList.add("fn__flex-1")
|
||||
flex1Element.style.height = "";
|
||||
flex1Element.classList.add("fn__flex-1");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue