mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-12-05 05:04:20 +00:00
2 lines
751 B
JavaScript
2 lines
751 B
JavaScript
/*! Widget: currentSort - 7/31/2016 (v2.27.0) */
|
|
!function(a){"use strict";var b=a.tablesorter;b.currentSortLanguage={0:"asc",1:"desc",2:"unsorted"},b.currentSort={init:function(a){a.$table.on("sortEnd.tscurrentSort",function(){b.currentSort.update(this.config)})},update:function(a){if(a){var c,d=a.widgetOptions,e=b.currentSortLanguage,f=e[2],g=Array.apply(null,Array(a.columns)).map(String.prototype.valueOf,f),h=a.sortList,i=h.length;for(c=0;c<i;c++)g[h[c][0]]=e[h[c][1]];a.currentSort=g,"function"==typeof d.currentSort_callback&&d.currentSort_callback(a,g)}}},b.addWidget({id:"currentSort",options:{currentSort_callback:null},init:function(a,c,d,e){b.currentSort.init(d,e)},remove:function(a,b){b.$table.off("sortEnd.tscurrentSort")}})}(jQuery); |