mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
🎨 https://github.com/siyuan-note/siyuan/issues/7536 gutter and resize
This commit is contained in:
parent
d74dbaa87e
commit
5cad47203a
3 changed files with 41 additions and 8 deletions
|
|
@ -49,19 +49,22 @@ export const avRender = (element: Element) => {
|
|||
|
||||
// body
|
||||
data.rows.forEach((row: IAVRow) => {
|
||||
tableHTML += `<div class="av__row" data-id="${row.id}"><div class="av__firstcol"><svg><use xlink:href="#iconUncheck"></use></svg></div>`;
|
||||
tableHTML += `<div class="av__row" data-id="${row.id}">
|
||||
<div class="av__gutters">
|
||||
<button><svg><use xlink:href="#iconLine"></use></svg></button>
|
||||
</div>
|
||||
<div class="av__firstcol"><svg><use xlink:href="#iconUncheck"></use></svg></div>`;
|
||||
row.cells.forEach((cell, index) => {
|
||||
tableHTML += `<div class="av__cell" data-index="${index}" style="width: ${data.columns[index].width || 200}px;${cell.bgColor ? `background-color:${cell.bgColor};` : ""}${cell.color ? `color:${cell.color};` : ""}">${cell.renderValue?.content || ""}</div>`;
|
||||
});
|
||||
tableHTML += "<div></div></div>";
|
||||
});
|
||||
const paddingLeft = parseInt(e.parentElement.style.paddingLeft) - 20;
|
||||
const paddingRight = parseInt(e.parentElement.style.paddingRight) - 20
|
||||
// 48: padding for gutter icon
|
||||
e.style.width = (e.parentElement.clientWidth - 48) + "px";
|
||||
const paddingLeft = e.parentElement.style.paddingLeft;
|
||||
const paddingRight = e.parentElement.style.paddingRight;
|
||||
e.style.width = e.parentElement.clientWidth + "px";
|
||||
e.style.alignSelf = "center";
|
||||
e.firstElementChild.outerHTML = `<div>
|
||||
<div style="padding-left: ${paddingLeft}px;padding-right: ${paddingRight}px">
|
||||
<div style="padding-left: ${paddingLeft};padding-right: ${paddingRight};">
|
||||
<div>
|
||||
<div>tab1</div>
|
||||
</div>
|
||||
|
|
@ -70,7 +73,7 @@ export const avRender = (element: Element) => {
|
|||
</div>
|
||||
</div>
|
||||
<div class="av__scroll">
|
||||
<div style="padding-left: ${paddingLeft}px;padding-right: ${paddingRight}px;float: left;">
|
||||
<div style="padding-left: ${paddingLeft};padding-right: ${paddingRight};float: left;">
|
||||
${tableHTML}
|
||||
<div class="block__icon block__icon--show">
|
||||
<div class="fn__space"></div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue