mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-08 05:32:33 +01:00
📱 repeat bind event
This commit is contained in:
parent
8d461d9481
commit
efffc97bec
5 changed files with 12 additions and 12 deletions
|
|
@ -13,6 +13,7 @@ import {hideElements} from "../protyle/ui/hideElements";
|
|||
import {pushBack} from "./util/MobileBackFoward";
|
||||
import {setStorageVal} from "../protyle/util/compatibility";
|
||||
import {showMessage} from "../dialog/message";
|
||||
import {saveScroll} from "../protyle/scroll/saveScroll";
|
||||
|
||||
export const openMobileFileById = (id: string, action = [Constants.CB_GET_HL]) => {
|
||||
window.siyuan.storage[Constants.LOCAL_DOCINFO] = {id, action};
|
||||
|
|
@ -44,6 +45,7 @@ export const openMobileFileById = (id: string, action = [Constants.CB_GET_HL]) =
|
|||
return;
|
||||
}
|
||||
if (window.siyuan.mobile.editor) {
|
||||
saveScroll(window.siyuan.mobile.editor.protyle);
|
||||
pushBack();
|
||||
addLoading(window.siyuan.mobile.editor.protyle);
|
||||
fetchPost("/api/filetree/getDoc", {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ ${unicode2Emoji(item.icon || Constants.SIYUAN_IMAGE_FILE, false, "b3-list-item__
|
|||
icon: "iconList",
|
||||
html: `<ul class="b3-list b3-list--mobile">${html}</ul>`,
|
||||
bindEvent(element: HTMLElement) {
|
||||
element.addEventListener("click", (event) => {
|
||||
element.firstElementChild.addEventListener("click", (event) => {
|
||||
const liElement = hasClosestByClassName(event.target as HTMLElement, "b3-list-item");
|
||||
if (liElement) {
|
||||
openMobileFileById(liElement.dataset.nodeId, [Constants.CB_GET_SCROLL])
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ export const initAbout = () => {
|
|||
openModel({
|
||||
title: window.siyuan.languages.about,
|
||||
icon: "iconInfo",
|
||||
html: `<div class="b3-label fn__flex${window.siyuan.config.readonly ? " fn__none" : ""}">
|
||||
html: `<div>
|
||||
<div class="b3-label fn__flex${window.siyuan.config.readonly ? " fn__none" : ""}">
|
||||
<div class="fn__flex-1">
|
||||
${window.siyuan.languages.about11}
|
||||
<div class="b3-label__text">${window.siyuan.languages.about12}</div>
|
||||
|
|
@ -131,12 +132,13 @@ export const initAbout = () => {
|
|||
</div>
|
||||
<div style="color:var(--b3-theme-surface);font-family: cursive;">会泽百家 至公天下</div>
|
||||
${window.siyuan.languages.about1}
|
||||
</div>
|
||||
</div>`,
|
||||
bindEvent(modelMainElement: HTMLElement) {
|
||||
const workspaceDirElement = modelMainElement.querySelector("#workspaceDir");
|
||||
genWorkspace(workspaceDirElement);
|
||||
const importKeyElement = modelMainElement.querySelector("#importKey");
|
||||
modelMainElement.addEventListener("click", (event) => {
|
||||
modelMainElement.firstElementChild.addEventListener("click", (event) => {
|
||||
let target = event.target as HTMLElement;
|
||||
while (target && !target.isSameNode(modelMainElement)) {
|
||||
if (target.id === "authCode") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue