mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 15:28:49 +01:00
🎨 多选单元格自动滚动
This commit is contained in:
parent
66acf8576d
commit
dc8ced773c
1 changed files with 15 additions and 0 deletions
|
|
@ -532,8 +532,23 @@ export class WYSIWYG {
|
|||
const originIndex = getPositionByCellElement(avCellElement);
|
||||
let moveCellElement: HTMLElement;
|
||||
let lastCellElement: HTMLElement;
|
||||
const nodeRect = nodeElement.getBoundingClientRect();
|
||||
const scrollElement = nodeElement.querySelector(".av__scroll");
|
||||
const contentRect = protyle.contentElement.getBoundingClientRect();
|
||||
documentSelf.onmousemove = (moveEvent: MouseEvent) => {
|
||||
const tempCellElement = hasClosestByClassName(moveEvent.target as HTMLElement, "av__cell") as HTMLElement;
|
||||
if (scrollElement.scrollWidth > scrollElement.clientWidth + 2) {
|
||||
if (moveEvent.clientX > nodeRect.right - 10) {
|
||||
scrollElement.scrollLeft += 10;
|
||||
} else if (moveEvent.clientX < nodeRect.left + 34) {
|
||||
scrollElement.scrollLeft -= 10;
|
||||
}
|
||||
if (moveEvent.clientY < contentRect.top + 48) {
|
||||
protyle.contentElement.scrollTop -= 5;
|
||||
} else if (moveEvent.clientY > contentRect.bottom - 48) {
|
||||
protyle.contentElement.scrollTop += 5;
|
||||
}
|
||||
}
|
||||
if (moveCellElement && tempCellElement && tempCellElement.isSameNode(moveCellElement)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue