Skip to content

Commit

Permalink
format + remove comment
Browse files Browse the repository at this point in the history
  • Loading branch information
YousefED committed Oct 30, 2024
1 parent 3dfe477 commit 3ad8fd9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
21 changes: 16 additions & 5 deletions src/columnresizing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,12 @@ function handleMouseDown(
}
}

displayColumnWidth(view, pluginState.activeHandle, width, defaultCellMinWidth);
displayColumnWidth(
view,
pluginState.activeHandle,
width,
defaultCellMinWidth,
);

win.addEventListener('mouseup', finish);
win.addEventListener('mousemove', move);
Expand Down Expand Up @@ -400,11 +405,17 @@ export function handleDecorations(
const dom = document.createElement('div');
dom.className = 'column-resize-handle';
if (columnResizingPluginKey.getState(state)?.dragging) {
decorations.push(Decoration.node(start + cellPos, start + cellPos + table.nodeAt(cellPos)!.nodeSize, {
class: 'column-resize-dragging'
}));
decorations.push(
Decoration.node(
start + cellPos,
start + cellPos + table.nodeAt(cellPos)!.nodeSize,
{
class: 'column-resize-dragging',
},
),
);
}

decorations.push(Decoration.widget(pos, dom));
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/tableview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export class TableView implements NodeView {
this.dom = document.createElement('div');
this.dom.className = 'tableWrapper';
this.table = this.dom.appendChild(document.createElement('table'));
this.table.style.setProperty('--default-cell-min-width', `${defaultCellMinWidth}px`);
this.table.style.setProperty(
'--default-cell-min-width',
`${defaultCellMinWidth}px`,
);
this.colgroup = this.table.appendChild(document.createElement('colgroup'));
updateColumnsOnResize(node, this.colgroup, this.table, defaultCellMinWidth);
this.contentDOM = this.table.appendChild(document.createElement('tbody'));
Expand Down
2 changes: 1 addition & 1 deletion style/tables.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.ProseMirror table {
border-collapse: collapse;
table-layout: fixed;
/* width: 100%; */
width: 100%;
overflow: hidden;
}
.ProseMirror td,
Expand Down

0 comments on commit 3ad8fd9

Please sign in to comment.