mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Inbox
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
3edc9e3cea
commit
af49c145bb
1 changed files with 13 additions and 17 deletions
|
|
@ -284,11 +284,11 @@ ${data.shorthandContent}
|
||||||
});
|
});
|
||||||
confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} ${removeTitle}?`, () => {
|
confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} ${removeTitle}?`, () => {
|
||||||
if (itemElement) {
|
if (itemElement) {
|
||||||
this.remove(itemElement.dataset.id);
|
this.remove([itemElement.dataset.id]);
|
||||||
} else if (detailsElement.classList.contains("fn__none")) {
|
} else if (detailsElement.classList.contains("fn__none")) {
|
||||||
this.remove();
|
this.remove();
|
||||||
} else {
|
} else {
|
||||||
this.remove(detailsElement.getAttribute("data-id"));
|
this.remove([detailsElement.getAttribute("data-id")]);
|
||||||
}
|
}
|
||||||
}, undefined, true);
|
}, undefined, true);
|
||||||
}
|
}
|
||||||
|
|
@ -308,22 +308,18 @@ ${data.shorthandContent}
|
||||||
window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY + 16});
|
window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY + 16});
|
||||||
}
|
}
|
||||||
|
|
||||||
private remove(id?: string) {
|
private remove(removeIds?: string[]) {
|
||||||
let ids: string[];
|
if (!removeIds) {
|
||||||
if (id) {
|
removeIds = this.selectIds;
|
||||||
ids = [id];
|
|
||||||
} else {
|
|
||||||
ids = this.selectIds;
|
|
||||||
}
|
}
|
||||||
fetchPost("/api/inbox/removeShorthands", {ids}, () => {
|
fetchPost("/api/inbox/removeShorthands", {ids:removeIds}, () => {
|
||||||
if (id) {
|
if (removeIds) {
|
||||||
this.back();
|
this.back();
|
||||||
this.selectIds.find((item, index) => {
|
for (let i = this.selectIds.length - 1; i >= 0; i--) {
|
||||||
if (item === id) {
|
if (removeIds.includes(this.selectIds[i])) {
|
||||||
this.selectIds.splice(index, 1);
|
this.selectIds.splice(i, 1);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
} else {
|
} else {
|
||||||
this.selectIds = [];
|
this.selectIds = [];
|
||||||
}
|
}
|
||||||
|
|
@ -348,11 +344,11 @@ ${data.shorthandContent}
|
||||||
notebook: toNotebook[0],
|
notebook: toNotebook[0],
|
||||||
path: pathPosix().join(getDisplayName(toPath[0], false, true), Lute.NewNodeID() + ".sy"),
|
path: pathPosix().join(getDisplayName(toPath[0], false, true), Lute.NewNodeID() + ".sy"),
|
||||||
title: replaceFileName(response.data.shorthandTitle),
|
title: replaceFileName(response.data.shorthandTitle),
|
||||||
md: md,
|
md,
|
||||||
listDocTree: true,
|
listDocTree: true,
|
||||||
});
|
});
|
||||||
this.remove(idItem);
|
|
||||||
}
|
}
|
||||||
|
this.remove(ids);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue