mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-21 22:44:06 +01:00
This commit is contained in:
parent
dad9bc58d6
commit
8554804ae2
2 changed files with 20 additions and 2 deletions
|
|
@ -3,6 +3,8 @@ import {fetchPost} from "../util/fetch";
|
|||
import {confirmDialog} from "../dialog/confirmDialog";
|
||||
import {escapeHtml} from "../util/escape";
|
||||
import {renameTag} from "../util/noRelyPCFunction";
|
||||
import {getDockByType} from "../layout/tabUtil";
|
||||
import {Tag} from "../layout/dock/Tag";
|
||||
|
||||
export const openTagMenu = (element: HTMLElement, event: MouseEvent, labelName: string) => {
|
||||
if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&
|
||||
|
|
@ -23,7 +25,14 @@ export const openTagMenu = (element: HTMLElement, event: MouseEvent, labelName:
|
|||
label: window.siyuan.languages.remove,
|
||||
click: () => {
|
||||
confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} <b>${escapeHtml(labelName)}</b>?`, () => {
|
||||
fetchPost("/api/tag/removeTag", {label: labelName});
|
||||
fetchPost("/api/tag/removeTag", {label: labelName}, () => {
|
||||
/// #if MOBILE
|
||||
window.siyuan.mobile.docks.tag.update();
|
||||
/// #else
|
||||
const dockTag = getDockByType("tag");
|
||||
(dockTag.data.tag as Tag).update();
|
||||
/// #endif
|
||||
});
|
||||
}, undefined, true);
|
||||
}
|
||||
}).element);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue