diff --git a/assets/js/stupidtable/stupidtable.js b/assets/js/stupidtable/stupidtable.js index 017a9fd543b..063f7c8cfb5 100644 --- a/assets/js/stupidtable/stupidtable.js +++ b/assets/js/stupidtable/stupidtable.js @@ -32,9 +32,9 @@ th_index = th_index - 1; // Determine (and/or reverse) sorting direction, default `asc` - var sort_dir = $this.data("sort-default") || dir.ASC; - if ($this.data("sort-dir")) - sort_dir = $this.data("sort-dir") === dir.ASC ? dir.DESC : dir.ASC; + var sort_dir = $this.data("sortDefault") || dir.ASC; + if ($this.data("sortDir")) + sort_dir = $this.data("sortDir") === dir.ASC ? dir.DESC : dir.ASC; // Choose appropriate sorting function. var type = $this.data("sort") || null; @@ -65,7 +65,7 @@ // with the TR itself into a tuple trs.each(function(index,tr) { var $e = $(tr).children().eq(th_index); - var sort_val = $e.data("sort-value"); + var sort_val = $e.data("sortValue"); var order_by = typeof(sort_val) !== "undefined" ? sort_val : $e.text(); column.push([order_by, tr]); }); @@ -83,8 +83,8 @@ }); // Reset siblings - $table.find("th").data("sort-dir", null).removeClass("sorting-desc sorting-asc"); - $this.data("sort-dir", sort_dir).addClass("sorting-"+sort_dir); + $table.find("th").data("sortDir", null).removeClass("sorting-desc sorting-asc"); + $this.data("sortDir", sort_dir).addClass("sorting-"+sort_dir); // Trigger `aftertablesort` event. Similar to `beforetablesort` $table.trigger("aftertablesort", {column: $this.index(), direction: sort_dir});