mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 00:50:13 +01:00
This commit is contained in:
parent
f95172353c
commit
fadd3f5b52
14 changed files with 56 additions and 24 deletions
|
|
@ -412,11 +412,15 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any) => {
|
|||
|
||||
export const resizeDrag = () => {
|
||||
const dragElement = document.getElementById("drag");
|
||||
const right = dragElement.getBoundingClientRect().left - document.querySelector("#windowControls").clientWidth - document.querySelector("#barSearch").clientWidth * 4;
|
||||
if (right < dragElement.clientWidth) {
|
||||
dragElement.style.paddingRight = right + "px";
|
||||
const width = dragElement.clientWidth
|
||||
const left = dragElement.getBoundingClientRect().left
|
||||
const right = document.querySelector("#windowControls").clientWidth + document.querySelector("#barSearch").clientWidth * 4;
|
||||
if (left > right && left - right < width) {
|
||||
dragElement.style.paddingRight = (left - right) + "px";
|
||||
} else if (left < right && right - left < width) {
|
||||
dragElement.style.paddingLeft = (right - left) + "px";
|
||||
} else {
|
||||
dragElement.style.paddingRight = "";
|
||||
dragElement.style.padding = "";
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue