mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
This commit is contained in:
parent
ba7f302de6
commit
f19a18e961
1 changed files with 2 additions and 8 deletions
|
|
@ -28,7 +28,7 @@ import {ipcRenderer} from "electron";
|
||||||
/// #endif
|
/// #endif
|
||||||
import {hideTooltip, showTooltip} from "../../dialog/tooltip";
|
import {hideTooltip, showTooltip} from "../../dialog/tooltip";
|
||||||
import {selectOpenTab} from "./util";
|
import {selectOpenTab} from "./util";
|
||||||
import {stopScrollAnimation} from "../../boot/globalEvent/dragover";
|
import {dragOverScroll, stopScrollAnimation} from "../../boot/globalEvent/dragover";
|
||||||
|
|
||||||
export class Files extends Model {
|
export class Files extends Model {
|
||||||
public element: HTMLElement;
|
public element: HTMLElement;
|
||||||
|
|
@ -491,13 +491,7 @@ export class Files extends Model {
|
||||||
if (window.siyuan.config.readonly || event.dataTransfer.types.includes(Constants.SIYUAN_DROP_TAB)) {
|
if (window.siyuan.config.readonly || event.dataTransfer.types.includes(Constants.SIYUAN_DROP_TAB)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const contentRect = this.element.getBoundingClientRect();
|
dragOverScroll(event, this.element.getBoundingClientRect(), this.element);
|
||||||
if (event.clientY < contentRect.top + Constants.SIZE_SCROLL_TB || event.clientY > contentRect.bottom - Constants.SIZE_SCROLL_TB) {
|
|
||||||
this.element.scroll({
|
|
||||||
top: this.element.scrollTop + (event.clientY < contentRect.top + Constants.SIZE_SCROLL_TB ? -Constants.SIZE_SCROLL_STEP : Constants.SIZE_SCROLL_STEP),
|
|
||||||
behavior: "smooth"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
let liElement = hasClosestByTag(event.target, "LI");
|
let liElement = hasClosestByTag(event.target, "LI");
|
||||||
if (!liElement) {
|
if (!liElement) {
|
||||||
liElement = hasClosestByTag(document.elementFromPoint(event.clientX, event.clientY - 1), "LI");
|
liElement = hasClosestByTag(document.elementFromPoint(event.clientX, event.clientY - 1), "LI");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue