mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
This commit is contained in:
parent
49305b8911
commit
51f66879cc
2 changed files with 4 additions and 5 deletions
|
|
@ -337,8 +337,6 @@ export const updateAVName = (protyle: IProtyle, blockElement: Element) => {
|
||||||
if (newData === nameElement.dataset.title.trim()) {
|
if (newData === nameElement.dataset.title.trim()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const newUpdated = dayjs().format("YYYYMMDDHHmmss")
|
|
||||||
blockElement.setAttribute("updated", newUpdated);
|
|
||||||
transaction(protyle, [{
|
transaction(protyle, [{
|
||||||
action: "setAttrViewName",
|
action: "setAttrViewName",
|
||||||
id: avId,
|
id: avId,
|
||||||
|
|
@ -346,17 +344,18 @@ export const updateAVName = (protyle: IProtyle, blockElement: Element) => {
|
||||||
}, {
|
}, {
|
||||||
action: "doUpdateUpdated",
|
action: "doUpdateUpdated",
|
||||||
id,
|
id,
|
||||||
data: newUpdated,
|
data: dayjs().format("YYYYMMDDHHmmss"),
|
||||||
}], [{
|
}], [{
|
||||||
action: "setAttrViewName",
|
action: "setAttrViewName",
|
||||||
id: avId,
|
id: avId,
|
||||||
name: nameElement.dataset.title,
|
data: nameElement.dataset.title,
|
||||||
}, {
|
}, {
|
||||||
action: "doUpdateUpdated",
|
action: "doUpdateUpdated",
|
||||||
id,
|
id,
|
||||||
data: blockElement.getAttribute("updated")
|
data: blockElement.getAttribute("updated")
|
||||||
}]);
|
}]);
|
||||||
nameElement.dataset.title = newData;
|
nameElement.dataset.title = newData;
|
||||||
|
blockElement.querySelector(".layout-tab-bar .item__text").textContent = newData;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const updateAttrViewCellAnimation = (cellElement: HTMLElement) => {
|
export const updateAttrViewCellAnimation = (cellElement: HTMLElement) => {
|
||||||
|
|
|
||||||
|
|
@ -254,7 +254,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else if (operation.action === "setAttrViewName") {
|
} else if (operation.action === "setAttrViewName") {
|
||||||
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${avId}"]`)).forEach((item: HTMLElement) => {
|
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.id}"]`)).forEach((item: HTMLElement) => {
|
||||||
const titleElement = item.querySelector(".av__title") as HTMLElement;
|
const titleElement = item.querySelector(".av__title") as HTMLElement;
|
||||||
if (!titleElement || titleElement.textContent.trim() === operation.data) {
|
if (!titleElement || titleElement.textContent.trim() === operation.data) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue