Skip to content

Commit

Permalink
🚨
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Oct 15, 2024
1 parent dbcd621 commit d8d9ff3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions app/src/menus/protyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
});
textElements[2].value = imgElement.getAttribute("alt") || "";
element.addEventListener("click", (event) => {
let target = event.target as HTMLElement
let target = event.target as HTMLElement;
while (target) {
if (target.dataset.action === "copy") {
writeText((target.parentElement.nextElementSibling as HTMLTextAreaElement).value);
Expand All @@ -1054,7 +1054,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
}
target = target.parentElement;
}
})
});
}
}).element);
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
Expand Down Expand Up @@ -1449,7 +1449,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
});

element.addEventListener("click", (event) => {
let target = event.target as HTMLElement
let target = event.target as HTMLElement;
while (target) {
if (target.dataset.action === "copy") {
writeText((target.parentElement.nextElementSibling as HTMLTextAreaElement).value);
Expand All @@ -1458,7 +1458,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
}
target = target.parentElement;
}
})
});
}
}).element);
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
Expand Down
2 changes: 1 addition & 1 deletion app/src/protyle/render/av/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
});
} else {
// 修改表格名 avID 传入到 id 上了 https://github.com/siyuan-note/siyuan/issues/12724
const avID = operation.action === "setAttrViewName" ? operation.id : operation.avID
const avID = operation.action === "setAttrViewName" ? operation.id : operation.avID;
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${avID}"]`)).forEach((item: HTMLElement) => {
item.removeAttribute("data-render");
const updateRow = item.querySelector('.av__row[data-need-update="true"]');
Expand Down
4 changes: 2 additions & 2 deletions app/src/protyle/wysiwyg/enter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle
const undoOperation: IOperation[] = [];
let currentElement = blockElement;
// 回车之前的块为 1\n\n2 时会产生多个块
const selectsElement: Element[] = []
const selectsElement: Element[] = [];
Array.from(enterElement.children).forEach((item: HTMLElement) => {
if (item.dataset.nodeId === id) {
blockElement.before(item);
Expand Down Expand Up @@ -303,7 +303,7 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle
currentElement = item;
selectsElement.push(item);
});
const parentElement = currentElement.parentElement
const parentElement = currentElement.parentElement;
transaction(protyle, doOperation, undoOperation);
if (parentElement.classList.contains("sb") && parentElement.getAttribute("data-sb-layout") === "col") {
turnsIntoOneTransaction({
Expand Down

0 comments on commit d8d9ff3

Please sign in to comment.