make admin users table resizable
This commit is contained in:
@ -21,17 +21,21 @@ export function resizeTableColumn(event: MouseEvent, dragOffset: number) {
|
||||
|
||||
const table = element.parentElement!.parentElement!.parentElement as HTMLTableElement;
|
||||
let resizeRow: HTMLTableRowElement;
|
||||
if (table.tBodies[0].rows[0].hidden) {
|
||||
resizeRow = table.rows[0];
|
||||
if (table.tBodies[0].rows[0].hasAttribute('resize-row')) {
|
||||
resizeRow = table.tBodies[0].rows[0];
|
||||
} else {
|
||||
resizeRow = table.tBodies[0].insertRow(0);
|
||||
resizeRow.hidden = true;
|
||||
resizeRow.setAttribute('resize-row', '');
|
||||
resizeRow.style.height = '0';
|
||||
resizeRow.style.border = '0';
|
||||
resizeRow.style.overflow = 'hidden';
|
||||
for (let i = 0; i < table.rows[0].cells.length; i++) {
|
||||
resizeRow.insertCell();
|
||||
const cell = resizeRow.insertCell();
|
||||
cell.style.padding = '0';
|
||||
}
|
||||
|
||||
// insert an additional to keep the zebra in place pattern which might be applied
|
||||
const zebraGhostRow = table.tBodies[0].insertRow(0);
|
||||
const zebraGhostRow = table.tBodies[0].insertRow(1);
|
||||
zebraGhostRow.hidden = true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user