mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
🚨
This commit is contained in:
parent
dbcd62198a
commit
d8d9ff3b26
3 changed files with 7 additions and 7 deletions
|
|
@ -1045,7 +1045,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
||||||
});
|
});
|
||||||
textElements[2].value = imgElement.getAttribute("alt") || "";
|
textElements[2].value = imgElement.getAttribute("alt") || "";
|
||||||
element.addEventListener("click", (event) => {
|
element.addEventListener("click", (event) => {
|
||||||
let target = event.target as HTMLElement
|
let target = event.target as HTMLElement;
|
||||||
while (target) {
|
while (target) {
|
||||||
if (target.dataset.action === "copy") {
|
if (target.dataset.action === "copy") {
|
||||||
writeText((target.parentElement.nextElementSibling as HTMLTextAreaElement).value);
|
writeText((target.parentElement.nextElementSibling as HTMLTextAreaElement).value);
|
||||||
|
|
@ -1054,7 +1054,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
||||||
}
|
}
|
||||||
target = target.parentElement;
|
target = target.parentElement;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||||
|
|
@ -1449,7 +1449,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
|
||||||
});
|
});
|
||||||
|
|
||||||
element.addEventListener("click", (event) => {
|
element.addEventListener("click", (event) => {
|
||||||
let target = event.target as HTMLElement
|
let target = event.target as HTMLElement;
|
||||||
while (target) {
|
while (target) {
|
||||||
if (target.dataset.action === "copy") {
|
if (target.dataset.action === "copy") {
|
||||||
writeText((target.parentElement.nextElementSibling as HTMLTextAreaElement).value);
|
writeText((target.parentElement.nextElementSibling as HTMLTextAreaElement).value);
|
||||||
|
|
@ -1458,7 +1458,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
|
||||||
}
|
}
|
||||||
target = target.parentElement;
|
target = target.parentElement;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||||
|
|
|
||||||
|
|
@ -434,7 +434,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 修改表格名 avID 传入到 id 上了 https://github.com/siyuan-note/siyuan/issues/12724
|
// 修改表格名 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) => {
|
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${avID}"]`)).forEach((item: HTMLElement) => {
|
||||||
item.removeAttribute("data-render");
|
item.removeAttribute("data-render");
|
||||||
const updateRow = item.querySelector('.av__row[data-need-update="true"]');
|
const updateRow = item.querySelector('.av__row[data-need-update="true"]');
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,7 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle
|
||||||
const undoOperation: IOperation[] = [];
|
const undoOperation: IOperation[] = [];
|
||||||
let currentElement = blockElement;
|
let currentElement = blockElement;
|
||||||
// 回车之前的块为 1\n\n2 时会产生多个块
|
// 回车之前的块为 1\n\n2 时会产生多个块
|
||||||
const selectsElement: Element[] = []
|
const selectsElement: Element[] = [];
|
||||||
Array.from(enterElement.children).forEach((item: HTMLElement) => {
|
Array.from(enterElement.children).forEach((item: HTMLElement) => {
|
||||||
if (item.dataset.nodeId === id) {
|
if (item.dataset.nodeId === id) {
|
||||||
blockElement.before(item);
|
blockElement.before(item);
|
||||||
|
|
@ -303,7 +303,7 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle
|
||||||
currentElement = item;
|
currentElement = item;
|
||||||
selectsElement.push(item);
|
selectsElement.push(item);
|
||||||
});
|
});
|
||||||
const parentElement = currentElement.parentElement
|
const parentElement = currentElement.parentElement;
|
||||||
transaction(protyle, doOperation, undoOperation);
|
transaction(protyle, doOperation, undoOperation);
|
||||||
if (parentElement.classList.contains("sb") && parentElement.getAttribute("data-sb-layout") === "col") {
|
if (parentElement.classList.contains("sb") && parentElement.getAttribute("data-sb-layout") === "col") {
|
||||||
turnsIntoOneTransaction({
|
turnsIntoOneTransaction({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue