mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
This commit is contained in:
parent
362be46bef
commit
4347d12af0
1 changed files with 7 additions and 0 deletions
|
|
@ -421,6 +421,13 @@ export class Files extends Model {
|
||||||
if (window.siyuan.config.readonly) {
|
if (window.siyuan.config.readonly) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const contentRect = this.element.getBoundingClientRect();
|
||||||
|
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