mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-26 00:44:07 +01:00
This commit is contained in:
parent
673c952f07
commit
af810b279d
2 changed files with 16 additions and 14 deletions
|
|
@ -156,7 +156,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
|
|||
const cellElement = hasClosestByClassName(event.target, "av__cell");
|
||||
if (cellElement && !cellElement.parentElement.classList.contains("av__row--header")) {
|
||||
const type = cellElement.parentElement.parentElement.firstElementChild.querySelector(`[data-col-id="${cellElement.getAttribute("data-col-id")}"]`).getAttribute("data-dtype") as TAVCol;
|
||||
if (type === "updated" || type === "created") {
|
||||
if (type === "updated" || type === "created" || (type === "block" && !cellElement.getAttribute("data-detached"))) {
|
||||
selectRow(cellElement.parentElement.querySelector(".av__firstcol"), "toggle");
|
||||
} else {
|
||||
selectRow(cellElement.parentElement.querySelector(".av__firstcol"), "unselect");
|
||||
|
|
|
|||
|
|
@ -457,19 +457,21 @@ const updateCellValue = (protyle: IProtyle, type: TAVCol, cellElements: HTMLElem
|
|||
if (type === "template") {
|
||||
const colId = cellElements[0].getAttribute("data-col-id");
|
||||
const textElement = avMaskElement.querySelector(".b3-text-field") as HTMLInputElement;
|
||||
transaction(protyle, [{
|
||||
action: "updateAttrViewColTemplate",
|
||||
id: colId,
|
||||
avID,
|
||||
data: textElement.value,
|
||||
type: "template",
|
||||
}], [{
|
||||
action: "updateAttrViewColTemplate",
|
||||
id: colId,
|
||||
avID,
|
||||
data: textElement.dataset.template,
|
||||
type: "template",
|
||||
}]);
|
||||
if (textElement.value !== textElement.dataset.template) {
|
||||
transaction(protyle, [{
|
||||
action: "updateAttrViewColTemplate",
|
||||
id: colId,
|
||||
avID,
|
||||
data: textElement.value,
|
||||
type: "template",
|
||||
}], [{
|
||||
action: "updateAttrViewColTemplate",
|
||||
id: colId,
|
||||
avID,
|
||||
data: textElement.dataset.template,
|
||||
type: "template",
|
||||
}]);
|
||||
}
|
||||
} else {
|
||||
cellElements.forEach((item) => {
|
||||
const rowElement = hasClosestByClassName(item, "av__row");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue