mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 16:58:49 +01:00
🎨 Improve "Use Default Column Width" (#15046)
fix https://github.com/siyuan-note/siyuan/issues/12776
This commit is contained in:
parent
6f37e913f5
commit
d968055aa7
2 changed files with 3 additions and 3 deletions
|
|
@ -2153,14 +2153,14 @@ export const tableMenu = (protyle: IProtyle, nodeElement: Element, cellElement:
|
|||
});
|
||||
}
|
||||
const thMatchElement = nodeElement.querySelectorAll("col")[colIndex];
|
||||
if (thMatchElement.style.width || thMatchElement.style.minWidth) {
|
||||
if (thMatchElement.style.width || thMatchElement.style.minWidth !== "60px") {
|
||||
otherMenus.push({
|
||||
id: "useDefaultWidth",
|
||||
label: window.siyuan.languages.useDefaultWidth,
|
||||
click: () => {
|
||||
const html = nodeElement.outerHTML;
|
||||
thMatchElement.style.width = "";
|
||||
thMatchElement.style.minWidth = "";
|
||||
thMatchElement.style.minWidth = "60px";
|
||||
updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, html);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ export const insertColumn = (protyle: IProtyle, nodeElement: Element, cellElemen
|
|||
newCellElement.textContent = " ";
|
||||
}
|
||||
}
|
||||
tableElement.querySelectorAll("col")[index].insertAdjacentHTML(type, "<col>");
|
||||
tableElement.querySelectorAll("col")[index].insertAdjacentHTML(type, "<col style='min-width: 60px;'>");
|
||||
focusByWbr(nodeElement, range);
|
||||
updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, html);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue