mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-14 00:16:13 +01:00
This commit is contained in:
parent
5f2f97db79
commit
6148e5fd29
3 changed files with 9 additions and 3 deletions
|
|
@ -593,7 +593,7 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;
|
|||
// https://github.com/siyuan-note/siyuan/issues/6864
|
||||
if (nodeElement.getAttribute("data-type") === "NodeTable") {
|
||||
nodeElement.querySelectorAll("colgroup col").forEach((item: HTMLElement) => {
|
||||
item.style.width = "80px";
|
||||
item.style.minWidth = "60px";
|
||||
});
|
||||
newHTML = nodeElement.outerHTML;
|
||||
}
|
||||
|
|
@ -610,7 +610,7 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;
|
|||
// https://github.com/siyuan-note/siyuan/issues/6864
|
||||
if (nodeElement.getAttribute("data-type") === "NodeTable") {
|
||||
nodeElement.querySelectorAll("colgroup col").forEach((item: HTMLElement) => {
|
||||
item.style.width = "80px";
|
||||
item.style.minWidth = "60px";
|
||||
});
|
||||
}
|
||||
transaction(protyle, [{
|
||||
|
|
|
|||
|
|
@ -389,6 +389,11 @@ export class WYSIWYG {
|
|||
const id = nodeElement.getAttribute("data-node-id");
|
||||
const x = event.clientX;
|
||||
const colElement = nodeElement.querySelectorAll("table col")[parseInt(target.getAttribute("data-col-index"))] as HTMLElement;
|
||||
// 清空初始化 table 时的最小宽度
|
||||
if (colElement.style.minWidth) {
|
||||
colElement.style.width = colElement.style.minWidth;
|
||||
colElement.style.minWidth = "";
|
||||
}
|
||||
// 兼容 1.8.2
|
||||
(nodeElement.querySelectorAll("table th")[parseInt(target.getAttribute("data-col-index"))] as HTMLElement).style.width = "";
|
||||
const oldWidth = colElement.clientWidth;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue