tablesorter/dist/js/widgets/widget-currentSort.min.js
2016-07-31 20:48:27 -05:00

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);