tablesorter/dist/js/widgets/widget-staticRow.min.js

2 lines
1.4 KiB
JavaScript
Raw Normal View History

2015-10-31 16:06:09 +00:00
/*! widget: staticRow - updated 10/31/2015 (v2.24.0) */
2017-04-02 11:33:20 +00:00
!function(a){"use strict";var b=a.tablesorter,c=function(b){var c,d,e,f,g,h=b.config;h&&(d=h.widgetOptions,h.$tbodies.each(function(){c=a(this).children(),g=c.length,c.filter(d.staticRow_class).each(function(){c=a(this),f=c.data(d.staticRow_index),void 0!==f?(e=parseFloat(f),f=/%/.test(f)?Math.round(e/100*g):e):f=c.index(),c.data(d.staticRow_data,f)})}))};b.addWidget({id:"staticRow",options:{staticRow_class:".static",staticRow_data:"static-index",staticRow_index:"row-index",staticRow_event:"staticRowsRefresh"},init:function(a,d,e,f){c(a),e.$table.unbind(("updateComplete.tsstaticrows "+f.staticRow_event).replace(/\s+/g," ")).bind("updateComplete.tsstaticrows "+f.staticRow_event,function(){c(a),b.applyWidget(a)})},format:function(b,c,d){var e,f,g,h,i,j,k,l;c.$tbodies.each(function(){for(i=a.tablesorter.processTbody(b,a(this),!0),j=!0,g=0,k=i.children(d.staticRow_class),h=i.children("tr").length-1,l=k.length;j&&g<l;)j=!1,k.each(function(){e=a(this).data(d.staticRow_data),(e=e>=h?h:e<0?0:e)!==a(this).index()&&(j=!0,f=a(this).detach(),e>=h?f.appendTo(i):0===e?f.prependTo(i):f.insertBefore(i.find("tr:eq("+e+")")))}),g++;a.tablesorter.processTbody(b,i,!1)}),c.$table.triggerHandler("staticRowsComplete",b)},remove:function(a,b,c){b.$table.unbind(("updateComplete.tsstaticrows "+c.staticRow_event).replace(/\s+/g," "))}})}(jQuery);