Skip to content

Commit

Permalink
🎨 fix #9587
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Nov 7, 2023
1 parent 67c4338 commit 1bf898e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/assets/scss/business/_block.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
min-height: 197px;
z-index: -1;
border: 1px solid var(--b3-theme-surface-lighter);
max-width: 1024px;

&--open {
opacity: 1;
Expand Down
6 changes: 6 additions & 0 deletions app/src/dialog/moveResize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const moveResize = (element: HTMLElement, afterCB?: (type: string) => voi
if (type === "r" &&
moveEvent.clientX - x + width > 200 && moveEvent.clientX - x + width < window.innerWidth) {
element.style.width = moveEvent.clientX - x + width + "px";
element.style.maxWidth = "none";
} else if (type === "d" &&
moveEvent.clientY - y + height > 160 && moveEvent.clientY - y + height < window.innerHeight - Constants.SIZE_TOOLBAR_HEIGHT) {
element.style.height = moveEvent.clientY - y + height + "px";
Expand All @@ -76,18 +77,21 @@ export const moveResize = (element: HTMLElement, afterCB?: (type: string) => voi
moveEvent.clientX > 0 && x - moveEvent.clientX + width > 200) {
element.style.left = moveEvent.clientX + "px";
element.style.width = (x - moveEvent.clientX + width) + "px";
element.style.maxWidth = "none";
} else if (type === "rd" &&
moveEvent.clientX - x + width > 200 && moveEvent.clientX - x + width < window.innerWidth &&
moveEvent.clientY - y + height > 160 && moveEvent.clientY - y + height < window.innerHeight - Constants.SIZE_TOOLBAR_HEIGHT) {
element.style.height = moveEvent.clientY - y + height + "px";
element.style.maxHeight = "";
element.style.maxWidth = "none";
element.style.width = moveEvent.clientX - x + width + "px";
} else if (type === "rt" &&
moveEvent.clientX - x + width > 200 && moveEvent.clientX - x + width < window.innerWidth &&
moveEvent.clientY > Constants.SIZE_TOOLBAR_HEIGHT && y - moveEvent.clientY + height > 160) {
element.style.width = moveEvent.clientX - x + width + "px";
element.style.top = moveEvent.clientY + "px";
element.style.maxHeight = "";
element.style.maxWidth = "none";
element.style.height = (y - moveEvent.clientY + height) + "px";
} else if (type === "lt" &&
moveEvent.clientX > 0 && x - moveEvent.clientX + width > 200 &&
Expand All @@ -96,6 +100,7 @@ export const moveResize = (element: HTMLElement, afterCB?: (type: string) => voi
element.style.width = (x - moveEvent.clientX + width) + "px";
element.style.top = moveEvent.clientY + "px";
element.style.maxHeight = "";
element.style.maxWidth = "none";
element.style.height = (y - moveEvent.clientY + height) + "px";
} else if (type === "ld" &&
moveEvent.clientX > 0 && x - moveEvent.clientX + width > 200 &&
Expand All @@ -104,6 +109,7 @@ export const moveResize = (element: HTMLElement, afterCB?: (type: string) => voi
element.style.width = (x - moveEvent.clientX + width) + "px";
element.style.height = moveEvent.clientY - y + height + "px";
element.style.maxHeight = "";
element.style.maxWidth = "none";
}
}
};
Expand Down

0 comments on commit 1bf898e

Please sign in to comment.