Vanessa 2024-04-20 10:04:21 +08:00
parent 6521d4c537
commit 4598025f2b
2 changed files with 6 additions and 3 deletions

View file

@ -394,7 +394,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
if (operation.action === "setAttrViewColWidth") {
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {
const cellElement = item.querySelector(`.av__cell[data-col-id="${operation.id}"]`) as HTMLElement;
if (!cellElement || cellElement.style.width === operation.data) {
if (!cellElement || cellElement.style.width === operation.data || item.getAttribute("custom-sy-av-view") !== operation.keyID) {
return;
}
item.querySelectorAll(".av__row").forEach(rowItem => {

View file

@ -439,18 +439,21 @@ export class WYSIWYG {
if (!newWidth || newWidth === oldWidth) {
return;
}
const viewId = nodeElement.getAttribute("custom-sy-av-view");
transaction(protyle, [{
action: "setAttrViewColWidth",
id: dragColId,
avID: avId,
data: newWidth + "px",
blockID
blockID,
keyID: viewId // 仅前端使用,用于推送时不影响其他视图 https://github.com/siyuan-note/siyuan/issues/11019
}], [{
action: "setAttrViewColWidth",
id: dragColId,
avID: avId,
data: oldWidth + "px",
blockID
blockID,
keyID: viewId
}]);
};
this.preventClick = true;