mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-06 12:50:16 +01:00
Add attribute "data-key" for Dialog (#10138)
This commit is contained in:
parent
b669d1a19c
commit
291211bd00
29 changed files with 103 additions and 0 deletions
|
|
@ -252,6 +252,7 @@ export const about = {
|
|||
</div>`,
|
||||
width: "520px",
|
||||
});
|
||||
passwordDialog.element.setAttribute("data-key", Constants.DIALOG_PASSWORD);
|
||||
const textAreaElement = passwordDialog.element.querySelector("textarea");
|
||||
textAreaElement.focus();
|
||||
const btnsElement = passwordDialog.element.querySelectorAll(".b3-button");
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import {ai} from "./ai";
|
|||
import {flashcard} from "./flashcard";
|
||||
import {App} from "../index";
|
||||
import {isHuawei} from "../protyle/util/compatibility";
|
||||
import {Constants} from "../constants";
|
||||
|
||||
export const genItemPanel = (type: string, containerElement: Element, app: App) => {
|
||||
switch (type) {
|
||||
|
|
@ -137,6 +138,7 @@ export const openSetting = (app: App) => {
|
|||
width: "90vw",
|
||||
height: "90vh",
|
||||
});
|
||||
dialog.element.setAttribute("data-key", Constants.DIALOG_SETTING);
|
||||
|
||||
initConfigSearch(dialog.element, app);
|
||||
(dialog.element.querySelector(".b3-dialog__container") as HTMLElement).style.maxWidth = "1280px";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import {Dialog} from "../../dialog";
|
||||
import {isMobile} from "../../util/functions";
|
||||
import {fetchPost} from "../../util/fetch";
|
||||
import {Constants} from "../../constants";
|
||||
|
||||
export const setAccessAuthCode = () => {
|
||||
const dialog = new Dialog({
|
||||
|
|
@ -17,6 +18,7 @@ export const setAccessAuthCode = () => {
|
|||
});
|
||||
const inputElement = dialog.element.querySelector("input") as HTMLInputElement;
|
||||
const btnsElement = dialog.element.querySelectorAll(".b3-button");
|
||||
dialog.element.setAttribute("data-key", Constants.DIALOG_ACCESSAUTHCODE);
|
||||
dialog.bindInput(inputElement, () => {
|
||||
(btnsElement[1] as HTMLButtonElement).click();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import {fetchPost} from "../../util/fetch";
|
|||
import {Dialog} from "../../dialog";
|
||||
import {objEquals} from "../../util/functions";
|
||||
import {confirmDialog} from "../../dialog/confirmDialog";
|
||||
import {Constants} from "../../constants";
|
||||
|
||||
export const renderSnippet = () => {
|
||||
fetchPost("/api/snippet/getSnippet", {type: "all", enabled: 2}, (response) => {
|
||||
|
|
@ -100,6 +101,7 @@ export const openSnippets = () => {
|
|||
contentElement.textContent = item.content;
|
||||
});
|
||||
const removeIds: string[] = [];
|
||||
dialog.element.setAttribute("data-key", Constants.DIALOG_SNIPPETS);
|
||||
dialog.element.addEventListener("click", (event) => {
|
||||
let target = event.target as HTMLElement;
|
||||
while (target && !target.isSameNode(dialog.element)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue