|
|
@@ -317,8 +317,12 @@
|
|
|
var $this = $(event.currentTarget);
|
|
|
|
|
|
this.$header.find('span.order').remove();
|
|
|
- this.options.sortName = $this.data('field');
|
|
|
- this.options.sortOrder = $this.data('order') === 'asc' ? 'desc' : 'asc';
|
|
|
+ if (this.options.sortName === $this.data('field')) {
|
|
|
+ this.options.sortOrder = this.options.sortOrder === 'asc' ? 'desc' : 'asc';
|
|
|
+ } else {
|
|
|
+ this.options.sortName = $this.data('field');
|
|
|
+ this.options.sortOrder = $this.data('order') === 'asc' ? 'desc' : 'asc';
|
|
|
+ }
|
|
|
this.trigger('sort', this.options.sortName, this.options.sortOrder);
|
|
|
|
|
|
$this.data('order', this.options.sortOrder);
|