From c55a1a9fafe0a51231cb3360bb3a990ab785388a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 29 Jun 2019 15:34:46 +0200 Subject: [PATCH] Simplify finding rows for sortable tables Including the table body is more intuitive than excluding the first row and the table foot. --- app/assets/javascripts/table_sortable.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/table_sortable.js.coffee b/app/assets/javascripts/table_sortable.js.coffee index 4aab0e445..49d833356 100644 --- a/app/assets/javascripts/table_sortable.js.coffee +++ b/app/assets/javascripts/table_sortable.js.coffee @@ -11,7 +11,7 @@ App.TableSortable = initialize: -> $("table.sortable th").click -> table = $(this).parents("table").eq(0) - rows = table.find("tr:gt(0)").not("tfoot tr").toArray().sort(App.TableSortable.comparer($(this).index())) + rows = table.find("tbody tr").toArray().sort(App.TableSortable.comparer($(this).index())) @asc = !@asc if @asc