Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/17628

Vanessa436483af0eb4
diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts
index 30b670ab09..8931b0f988 100644
--- a/app/src/layout/dock/Files.ts
+++ b/app/src/layout/dock/Files.ts
@@ -445,6 +445,7 @@ export class Files extends Model {
}
});
this.element.addEventListener("dragstart", (event: DragEvent & { target: HTMLElement }) => {
+ if (window.siyuan.config.readonly) return;
window.getSelection().removeAllRanges();
hideTooltip();
const liElement = hasClosestByTag(event.target, "LI");
diff --git a/app/src/mobile/dock/MobileFiles.ts b/app/src/mobile/dock/MobileFiles.ts
index 7479f8fae4..7edbbd5e8f 100644
--- a/app/src/mobile/dock/MobileFiles.ts
+++ b/app/src/mobile/dock/MobileFiles.ts
@@ -353,7 +353,7 @@ export class MobileFiles extends Model {
</li>`;
} else {
return `<ul class="b3-list b3-list--background" data-url="${item.id}" data-sortmode="${item.sortMode}">
-<li class="b3-list-item" data-type="navigation-root" data-path="/">
+<li class="b3-list-item" data-type="navigation-root" data-path="/" style="--file-toggle-width:24px">
<span class="b3-list-item__toggle${item.closed ? " fn__hidden" : ""}">
<svg class="b3-list-item__arrow"><use xlink:href="#iconRight"></use></svg>
</span>
@@ -794,10 +794,11 @@ export class MobileFiles extends Model {
if (item.count && item.count > 0) {
countHTML = `<span class="counter">${item.count}</span>`;
}
+ const paddingLeft = (item.path.split("/").length - 1) * 20;
const editingPublishAccess = this.actionsElement.querySelector('[data-type="publish-access"]').classList.contains("block__icon--active");
return `<li data-node-id="${item.id}" data-name="${Lute.EscapeHTMLStr(item.name)}" data-type="navigation-file"
-class="b3-list-item" data-path="${item.path}">
- <span style="padding-left: ${(item.path.split("/").length - 1) * 20}px" class="b3-list-item__toggle${item.subFileCount === 0 ? " fn__hidden" : ""}">
+class="b3-list-item" data-path="${item.path}" style="--file-toggle-width:${paddingLeft + 20}px" >
+ <span style="padding-left: ${paddingLeft}px" class="b3-list-item__toggle${item.subFileCount === 0 ? " fn__hidden" : ""}">
<svg class="b3-list-item__arrow"><use xlink:href="#iconRight"></use></svg>
</span>
<span class="b3-list-item__icon"${editingPublishAccess ? " fn__none" : ""}>${unicode2Emoji(item.icon || (item.subFileCount === 0 ? window.siyuan.storage[Constants.LOCAL_IMAGES].file : window.siyuan.storage[Constants.LOCAL_IMAGES].folder))}</span>
diff --git a/app/src/mobile/util/touch.ts b/app/src/mobile/util/touch.ts
index 2862ff5de5..0874931ac2 100644
--- a/app/src/mobile/util/touch.ts
+++ b/app/src/mobile/util/touch.ts
@@ -173,8 +173,12 @@ export const handleTouchStart = (event: TouchEvent) => {
// 存在其他拖拽元素时
const otherTouchElement = hasClosestByClassName(target, "b3-chip");
if ((otherTouchElement && otherTouchElement.parentElement.classList.contains("b3-chips__doctag")) ||
- hasClosestByClassName(target, "protyle-gutters") ||
+ target.closest(".protyle-gutters")||
+ target.closest('[style^="--file-toggle-width"]') ||
(target.tagName === "IMG" && target.style.cursor === "move" && target.parentElement.classList.contains("protyle-background__img"))) {
+ clientX = null;
+ clientY = null;
+ time = 0;
return;
}
if (getSelection().rangeCount > 0 && hasClosestBlock(event.target as Element)) {