obsidian-sortable
obsidian-sortable copied to clipboard
Install `onClick` event only for table headers
Current implementation:
function onClick(evt: MouseEvent): void {
const htmlEl = (<HTMLInputElement>evt.target);
const th = htmlEl.closest('thead th');
// click was not performed in a table, exit
if (th == null) { return; }
// click was performed in a table
// ...
}
Maybe it's better to do this rather than registering onClick
events for all table headers in the current page?