Optimise clickable rows
Set a click handler on the table instead of on every row. This should be faster on large tables. Also, it's easier to use: you just set the clickable-rows class on the table, and the row-link class on the <a> element that contains the "main" link of the row.
This commit is contained in:
@ -72,6 +72,13 @@
|
||||
});
|
||||
});
|
||||
|
||||
$("table.clickable-rows").click(function(event) {
|
||||
if ($(event.target).closest("a").length) return;
|
||||
link = $(event.target).parents("tr").find("a.row-link");
|
||||
if (link.length == 1)
|
||||
window.location = link.attr("href");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user