mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-26 00:44:07 +01:00
This commit is contained in:
parent
b4395bfca4
commit
e936a2d5d7
5 changed files with 77 additions and 17 deletions
|
|
@ -605,7 +605,7 @@ export class MobileFiles extends Model {
|
|||
}
|
||||
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 - 2) * 18 + 22}px" class="b3-list-item__toggle${item.subFileCount === 0 ? " fn__hidden" : ""}">
|
||||
<span style="padding-left: ${(item.path.split("/").length - 2) * 29 + 40}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">${unicode2Emoji(item.icon || (item.subFileCount === 0 ? Constants.SIYUAN_IMAGE_FILE : Constants.SIYUAN_IMAGE_FOLDER))}</span>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,8 @@ export const initFramework = () => {
|
|||
let bookmark: MobileBookmarks;
|
||||
let tag: MobileTags;
|
||||
// 不能使用 getEventName,否则点击返回会展开右侧栏
|
||||
sidebarElement.querySelector(".toolbar--border").addEventListener("click", (event: Event & {
|
||||
const firstToolbarElement = sidebarElement.querySelector(".toolbar--border")
|
||||
firstToolbarElement.addEventListener("click", (event: Event & {
|
||||
target: Element
|
||||
}) => {
|
||||
const svgElement = hasTopClosestByTag(event.target, "svg");
|
||||
|
|
@ -41,8 +42,11 @@ export const initFramework = () => {
|
|||
closePanel();
|
||||
return;
|
||||
}
|
||||
sidebarElement.querySelectorAll(".toolbar--border svg").forEach(item => {
|
||||
firstToolbarElement.querySelectorAll(".toolbar__icon").forEach(item => {
|
||||
const itemType = item.getAttribute("data-type");
|
||||
if (!itemType) {
|
||||
return;
|
||||
}
|
||||
if (itemType === type) {
|
||||
if (type === "sidebar-outline-tab") {
|
||||
if (!outline) {
|
||||
|
|
@ -57,13 +61,13 @@ export const initFramework = () => {
|
|||
backlink.update();
|
||||
}
|
||||
} else if (type === "sidebar-bookmark-tab") {
|
||||
if (!backlink) {
|
||||
if (!bookmark) {
|
||||
bookmark = new MobileBookmarks();
|
||||
} else {
|
||||
backlink.update();
|
||||
}
|
||||
} else if (type === "sidebar-tag-tab") {
|
||||
if (!backlink) {
|
||||
if (!tag) {
|
||||
tag = new MobileTags();
|
||||
} else {
|
||||
tag.update();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue