mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-18 04:58:06 +01:00
This commit is contained in:
parent
b4395bfca4
commit
e936a2d5d7
5 changed files with 77 additions and 17 deletions
|
|
@ -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