mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 16:58:49 +01:00
This commit is contained in:
parent
7d19a8e88c
commit
04ac712988
3 changed files with 16 additions and 8 deletions
|
|
@ -32,6 +32,9 @@ export const makeCard = (nodeElement: Element[]) => {
|
|||
let html = "";
|
||||
const ids: string[] = [];
|
||||
nodeElement.forEach(item => {
|
||||
if (item.getAttribute("data-type") === "NodeThematicBreak") {
|
||||
return;
|
||||
}
|
||||
ids.push(item.getAttribute("data-node-id"));
|
||||
});
|
||||
response.data.forEach((item: ICard) => {
|
||||
|
|
|
|||
|
|
@ -1437,14 +1437,16 @@ export class Gutter {
|
|||
}
|
||||
}).element);
|
||||
}
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.riffCard,
|
||||
icon: "iconRiffCard",
|
||||
click() {
|
||||
makeCard([nodeElement]);
|
||||
}
|
||||
}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||
if (type !== "NodeThematicBreak") {
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.riffCard,
|
||||
icon: "iconRiffCard",
|
||||
click() {
|
||||
makeCard([nodeElement]);
|
||||
}
|
||||
}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||
}
|
||||
let updateHTML = nodeElement.getAttribute("updated") || "";
|
||||
if (updateHTML) {
|
||||
updateHTML = `${window.siyuan.languages.modifiedAt} ${dayjs(updateHTML).format("YYYY-MM-DD HH:mm:ss")}<br>`;
|
||||
|
|
|
|||
|
|
@ -446,6 +446,9 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, focus: b
|
|||
return;
|
||||
}
|
||||
protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach(item => {
|
||||
if (item.getAttribute("data-type") === "NodeThematicBreak") {
|
||||
return;
|
||||
}
|
||||
Object.keys(data.old).forEach(key => {
|
||||
item.removeAttribute(key);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue