Vanessa 2022-10-15 11:35:53 +08:00
parent f95172353c
commit fadd3f5b52
14 changed files with 56 additions and 24 deletions

View file

@ -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 = "";
}
};