2015-03-10 17:05:02 +00:00
|
|
|
!function(a,b){"use strict";a.fn.hasScrollBar=function(){return this.get(0).scrollHeight>this.height()};var c=a.tablesorter;c.window_resize=function(){this.resize_timer&&clearTimeout(this.resize_timer),this.resize_timer=setTimeout(function(){a(this).trigger("resizeEnd")},250)},a(function(){var b="<style>.tablesorter-scrollbar-measure { width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px; } .tablesorter-scroller-reset { width: auto !important; } .tablesorter-scroller { text-align: left; overflow: hidden; }.tablesorter-scroller-header, .tablesorter-scroller-footer { overflow: hidden; }.tablesorter-scroller-header table.tablesorter { margin-bottom: 0; }.tablesorter-scroller-footer table.tablesorter thead { visibility: hidden, height: 0; overflow: hidden; }.tablesorter-scroller-table { overflow-y: scroll; }.tablesorter-scroller-table table.tablesorter { margin-top: 0; margin-bottom: 0; overflow: scroll; } .tablesorter-scroller-table .tablesorter-filter-row,.tablesorter-scroller-footer .tablesorter-filter-row,.tablesorter-scroller-table tfoot { display: none; }.tablesorter-scroller-table table.tablesorter thead tr.tablesorter-headerRow *,.tablesorter-scroller-footer table.tablesorter thead * {line-height:0;height:0;border:none;background-image:none;padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;overflow:hidden;}</style>";a(b).appendTo("body")}),c.addWidget({id:"scroller",priority:60,options:{scroller_height:300,scroller_jumpToHeader:!0,scroller_upAfterSort:!0,scroller_barWidth:null},init:function(d,e,f){var g=a(b),h=f.namespace+"tsscroller";g.bind("resize"+h,c.window_resize).bind("resizeEnd"+h,function(){a.isFunction(d.config.widgetOptions.scroller_resizeWidth)&&(g.unbind("resize"+h,c.window_resize),d.config.widgetOptions.scroller_resizeWidth(),g.bind("resize"+h,c.window_resize))})},format:function(d,e,f){var g,h,i,j,k,l,m,n,o,p=a(),q=e.namespace.slice(1)+"tsscroller",r=a(b),s=e.$table;e.isScrolling||(e.widthFixed=!0,g=f.scroller_height||300,h=s.children("tbody").height(),0!==h&&g>h&&(g=h+10),i=a('<table class="'+s.attr("class")+'" cellpadding=0 cellspacing=0>'+s.children("thead")[0].outerHTML+"</table>"),j=s.children("tfoot"),j.length&&(p=a('<table class="'+s.attr("class")+'" cellpadding=0 cellspacing=0 style="margin-top:0"></table>').append(j.clone(!0)).append(s.children("thead")[0].outerHTML).wrap('<div class="tablesorter-scroller-footer"/>'),n=p.children("tfoot").eq(0).children("tr").children()),e.$extraTables=e.$extraTables&&e.$extraTables.length?e.$extraTables.add(i).add(p):i.add(p),s.wrap('<div id="'+q+'" class="tablesorter-scroller" />').before(i).find(".tablesorter-filter-row").addClass("hideme"),p.length&&s.after(p.parent()),m=i.wrap('<div class="tablesorter-scroller-header" />').find("."+c.css.header),s.wrap('<div class="tablesorter-scroller-table" style="max-height:'+g+'px;" />'),o=s.parent(),c.bindEvents(d,m),s.hasClass("hasFilters")&&c.filter.bindSearch(s,i.find("."+c.css.filter)),l=function(){var b=a('<div class="tablesorter-scrollbar-measure">').appendTo("body"),c=b[0],d=c.offsetWidth-c.clientWidth;return b.remove(),d},k=function(){var c,e,g,h,j=a('div.tablesorter-scroller[id != "'+q+'"]').hide();s.children("thead").show(),s.add(i).add(p).children("colgroup").remove(),s.addClass("tablesorter-scroller-reset").children("thead").find(".tablesorter-header-inner").addClass("tablesorter-scroller-reset").end().find(".tablesorter-filter-row").show(),o.addClass("tablesorter-scroller-reset"),o.parent().trigger("resize"),c=parseInt(s.css("border-left-width"),10)+parseInt(s.css("border-right-width"),10),h=(f.scroller_barWidth||l())+c,o.width(o.parent().innerWidth()-(o.parent().hasScrollBar()?h:0)),h=o.innerWidth()-(o.hasScrollBar()?h:0),i.parent().add(p.parent()).width(h),h=s.width(),e=i.children("thead").children().children("th, td").filter(":visible"),g=p.children("tfoot").children().children("th, td").filter(":visible"),s.children("thead").children().eq(0).children("th, td").each(function(c){var d,f,h=a(this);"border-box"===h.css("box-sizing")?d=h.outerWidth():"collapse"===e.e
|