Update stupidtable.js to resolve jQuery data change in jQuery 3
This commit is contained in:
parent
a95f084d9f
commit
c9b1012095
|
@ -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});
|
||||
|
|
Loading…
Reference in New Issue