Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
document.getElementById('insertTable').addEventListener('click', function() {
let columns = Math.min(parseInt(window.prompt('How many columns?')), 10);
let rows = Math.min(parseInt(window.prompt('How many rows?')), 10);
if (columns > 0 && rows > 0) {
insertTable(getCurrentEditor(), columns, rows);
}
});
private onInsertTable = (cols: number, rows: number) => {
insertTable(this.editor, cols, rows);
};
}
private onInsertTable = () => {
this.props.onDismiss();
let cols = parseInt(this.cols.current.value);
let rows = parseInt(this.rows.current.value);
if (cols > 0 && cols <= 10 && rows > 0 && rows <= 10) {
insertTable(this.props.editor, cols, rows);
}
};