mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
8dc6420bee
commit
1da6bd10dd
2 changed files with 31 additions and 2 deletions
|
|
@ -777,7 +777,7 @@ export class Files extends Model {
|
|||
currentPath = dirname + ".sy";
|
||||
}
|
||||
} else {
|
||||
liElement.querySelector("fn__hidden").classList.remove("fn__hidden");
|
||||
liElement.querySelector(".fn__hidden").classList.remove("fn__hidden");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,8 +67,14 @@ export class MobileFiles extends Model {
|
|||
case "removeDoc":
|
||||
this.onRemove(data);
|
||||
break;
|
||||
case "createdailynote":
|
||||
case "create":
|
||||
if (data.data.listDocTree) {
|
||||
this.selectItem(data.data.box.id, data.data.path);
|
||||
} else {
|
||||
this.updateItemArrow(data.data.box.id, data.data.path);
|
||||
}
|
||||
break;
|
||||
case "createdailynote":
|
||||
case "heading2doc":
|
||||
case "li2doc":
|
||||
this.onMkdir(data.data);
|
||||
|
|
@ -267,6 +273,29 @@ export class MobileFiles extends Model {
|
|||
window.siyuan.menus.menu.fullscreen("bottom");
|
||||
}
|
||||
|
||||
private updateItemArrow(notebookId: string, filePath: string) {
|
||||
const treeElement = this.element.querySelector(`[data-url="${notebookId}"]`);
|
||||
if (!treeElement) {
|
||||
return;
|
||||
}
|
||||
let currentPath = filePath;
|
||||
let liElement
|
||||
while (!liElement) {
|
||||
liElement = treeElement.querySelector(`[data-path="${currentPath}"]`);
|
||||
if (!liElement) {
|
||||
const dirname = pathPosix().dirname(currentPath);
|
||||
if (dirname === "/") {
|
||||
currentPath = dirname;
|
||||
} else {
|
||||
currentPath = dirname + ".sy";
|
||||
}
|
||||
} else {
|
||||
liElement.querySelector(".fn__hidden").classList.remove("fn__hidden");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private genNotebook(item: INotebook) {
|
||||
const emojiHTML = `<span class="b3-list-item__icon b3-tooltips b3-tooltips__e" aria-label="${window.siyuan.languages.changeIcon}">${unicode2Emoji(item.icon || window.siyuan.storage[Constants.LOCAL_IMAGES].note)}</span>`;
|
||||
if (item.closed) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue