INNER CODE UNIT · JavaScript
handleResize
ongres/stackgres · stackgres-k8s/src/admin-ui/src/main.js:61
const handleResize = e => {
if (opt.resizable === false) return;
if (!opt.fixedWidthTable) {
activeTh.style.width = parseInt(activeTh.style.width) + e.movementX + 'px';
neighbourghTh.style.width = parseInt(neighbourghTh.style.width) - e.movementX + 'px';
} else {
activeTh.style.width = parseInt(activeTh.style.width) + e.movementX + 'px';
table.style.width = parseInt(table.style.width) + e.movementX + 'px';
}
};
let activeTh = null; // the th being resized
let neighbourghTh = null; // the next except when the last column is being resized in that case it is the previous
let resizing = false; // a resize started needed because we can not detect event handler was attached or not
table.style.position = 'relative';
applyTableWidth();