tablesorter/dist/js/widgets/widget-staticRow.min.js
Mottie 263aa97e66 Build: add combined file with selected widgets & parsers. See #855
NOTE: the core js/jquery.tablesorter.js file is no longer UMD wrapped!; this is done by the build process now

Updated various parser & widget comments
2015-03-28 15:03:50 -05:00

2 lines
1.4 KiB
JavaScript

/*! widget: staticRow - updated 2/9/2015 (v2.19.1) */
!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),"undefined"!=typeof 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,b,d,e){c(a),d.$table.unbind(("updateComplete.tsstaticrows "+e.staticRow_event).replace(/\s+/g," ")).bind("updateComplete.tsstaticrows "+e.staticRow_event,function(){c(a),d.$table.trigger("applyWidgets")})},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&&l>g;)j=!1,k.each(function(){e=a(this).data(d.staticRow_data),e=e>=h?h:0>e?0:e,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.trigger("staticRowsComplete",b)},remove:function(a,b,c){b.$table.unbind(("updateComplete.tsstaticrows "+c.staticRow_event).replace(/\s+/g," "))}})}(jQuery);