mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 00:20:12 +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
|
|
@ -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