/*! Widget: scroller - updated 5/17/2015 (v2.22.0) */ !function(a,b){"use strict";var c=a.tablesorter,d=c.css;a.extend(c.css,{scrollerWrap:"tablesorter-scroller",scrollerHeader:"tablesorter-scroller-header",scrollerTable:"tablesorter-scroller-table",scrollerFooter:"tablesorter-scroller-footer",scrollerFixed:"tablesorter-scroller-fixed",scrollerFixedPanel:"tablesorter-scroller-fixed-panel",scrollerHasFix:"tablesorter-scroller-has-fixed-columns",scrollerReset:"tablesorter-scroller-reset",scrollerRtl:"tablesorter-scroller-rtl"}),c.addWidget({id:"scroller",priority:60,options:{scroller_height:300,scroller_jumpToHeader:!0,scroller_upAfterSort:!0,scroller_fixedColumns:0,scroller_rowHighlight:"hover",scroller_addFixedOverlay:!1,scroller_barWidth:null},format:function(a,b,d){b.isScrolling||c.scroller.setup(b,d)},remove:function(a,b,d){c.scroller.remove(b,d)}}),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="";a(b).appendTo("body")}),c.scroller={isFirefox:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isOldIE:document.all&&!b.atob,hasScrollBar:function(a){return a.get(0).scrollHeight>a.height()},setWidth:function(a,b){a.css({width:b,"min-width":b,"max-width":b})},getBarWidth:function(){var b=a('
').appendTo("body"),c=b[0],e=c.offsetWidth-c.clientWidth;return b.remove(),e},setup:function(e,f){var g,h,i,j,k,l,m,n=a(b),o=e.namespace+"tsscroller",p=a(),q=e.namespace.slice(1)+"tsscroller",r=e.$table;e.widthFixed=!0,g=f.scroller_height||300,h=r.children("tbody").height(),0!==h&&g>h&&(g=h+10),f.scroller_$header=i=a(''+r.children("thead")[0].outerHTML+"
").addClass(e.namespace.slice(1)+"_extra_table"),j=r.children("tfoot"),j.length&&(p=a('
').addClass(e.namespace.slice(1)+"_extra_table").append(j.clone(!0)).append(r.children("thead")[0].outerHTML).wrap('
'),l=p.children("tfoot").eq(0).children("tr").children()),f.scroller_$footer=p,r.wrap('
').before(i).find("."+d.filterRow).addClass(d.filterRowHide),f.scroller_$container=r.parent(),p.length&&r.after(p.parent()),k=i.wrap('
').find("."+d.header),r.wrap('
'),m=r.parent(),c.bindEvents(e.table,k),r.hasClass("hasFilters")&&c.filter.bindSearch(r,i.find("."+d.filter)),f.scroller_$container.find("."+d.scrollerFixed).remove(),f.scroller_fixedColumns>0&&c.scroller.setupFixed(e,f),c.scroller.resize(e,f),r.find("thead").css("visibility","hidden"),h=m.parent().height(),m.off("scroll"+o).on("scroll"+o,function(){if(f.scroller_jumpToHeader){var b=n.scrollTop()-i.offset().top;0!==a(this).scrollTop()&&h>b&&b>0&&n.scrollTop(i.offset().top)}i.parent().add(p.parent()).scrollLeft(a(this).scrollLeft())}),r.off("sortEnd setFixedColumnSize updateComplete ".split(" ").join(o+" ")).on("sortEnd"+o,function(){f.scroller_upAfterSort&&r.parent().animate({scrollTop:0},"fast")}).on("setFixedColumnSize"+o,function(a,b){"undefined"==typeof b||isNaN(b)||(f.scroller_fixedColumns=parseInt(b,10)),f.scroller_$container.find("."+d.scrollerFixed).remove(),b=f.scroller_fixedColumns,b>0&&b0&&c.scroller.updateFixed(e,f,!0),o.children("thead").find("."+d.filterRow).hide(),t.show()},setupFixed:function(b,e){var f,g,h,i,j,k,l,m,n=b.$table,o=b.namespace+"tsscrollerFixed",p=e.scroller_$container,q=e.scroller_fixedColumns;for(k=p.addClass(d.scrollerHasFix).clone().addClass(d.scrollerFixed).removeClass(d.scrollerWrap).attr("id",""),e.scroller_addFixedOverlay&&k.append('
'),l=k.find("."+d.scrollerTable),l.find("table").addClass(b.namespace.slice(1)+"_extra_table").attr("id",""),m=l.find("tbody"),e.scroller_$fixedColumns=k,n.hasClass(d.scrollerRtl)&&k.addClass(d.scrollerRtl),h=k.find("tr"),i=h.length,f=0;i>f;f++)h.eq(f).children(":gt("+(q-1)+")").remove();if(k.hide().prependTo(p),b.$table.hasClass("hasFilters"))for(c.filter.bindSearch(n,k.find("."+d.filter)),h=p.children("."+d.scrollerHeader).find("."+d.filter),i=h.length,f=0;i>f;f++)h.eq(f).hasClass(d.filterDisabled||"disabled")||h.eq(f).prop("disabled",q>f);for(b.$table.add("."+d.scrollerFooter+" table").children("thead").children("tr."+d.headerRow).children().attr("tabindex",-1),h=e.scroller_$header.add(k.find("."+d.scrollerTable+" table")).children("thead").children("tr."+d.headerRow),i=h.length,f=0;i>f;f++)for(j=h.eq(f).children(),g=0;gg?-1:0);c.bindEvents(b.table,k.find("."+d.header)),j="tablesorter-initialized sortEnd filterEnd ".split(" ").join(o+" "),b.$table.off(j).on(j,function(){c.scroller.updateFixed(b,e,!1)}).parent().off("scroll"+o).on("scroll"+o,function(){l.scrollTop(a(this).scrollTop())}),l.off("scroll"+o).on("scroll"+o,function(){b.$table.parent().scrollTop(l.scrollTop())}).scroll(),""!==e.scroller_rowHighlight&&(j="mouseover mouseleave ".split(" ").join(o+" "),b.$table.off(j,"tr").on(j,"tr",function(b){var c=a(this).index();m.children().eq(c).add(this).toggleClass(e.scroller_rowHighlight,"mouseover"===b.type)}),l.find("table").off(j,"tr").on(j,"tr",function(c){var d=a(this).index();b.$tbodies.children().eq(d).add(this).toggleClass(e.scroller_rowHighlight,"mouseover"===c.type)})),(c.scroller.isFirefox||c.scroller.isOldIE)&&l.wrap('
'),c.scroller.updateFixed(b,e,!0)},updateFixed:function(b,e){if(b.isScrolling){b.$table.parent().width(e.scroller_$container.width());var f,g,h,i,j,k,l,m,n=b.$table,o=e.scroller_$container,p=e.scroller_$container.children("."+d.scrollerTable).children("table").children("tbody"),q=e.scroller_$header.children("thead").children("."+d.headerRow),r=e.scroller_$fixedColumns.hide(),s=r.find("."+d.scrollerTable).children("table"),t=s.children("tbody"),u=r.find("."+d.scrollerHeader).children("table").children("thead"),v=c.scroller,w=e.scroller_barSetWidth,x=e.scroller_fixedColumns,y=n.find("tbody td"),z=parseInt(y.css("border-right-width"),10)||1,A=parseInt(y.css("border-bottom-width"),10)||1,B=parseInt(y.css("border-spacing").split(/\s/)[0],10)/2||0,C=parseInt(n.css("padding-left"),10)+parseInt(n.css("padding-right"),10)-z;for(y=u.children("."+d.headerRow),f=0;f0?b.$tbodies:n.children("thead")).children("tr:visible"),m=q.children(":lt("+x+")").map(function(){return C+=a(this).outerWidth()+B,a(this).outerWidth()}).get(),v.setWidth(r.add(r.children()),C+2*z-B),v.setWidth(r.find("table"),C+z),r.height(o.height()),e.scroller_$footer.length)for(y=o.children("."+d.scrollerFooter).find("tfoot tr"),q=r.find("."+d.scrollerFooter+" tfoot tr"),f=0;fh;h++)j=a(q[h].outerHTML),j.children("td, th").slice(x).remove(),j.children().eq(0).height(q.eq(h).outerHeight()-(v.isFirefox?2*A:0)),0===h&&v.setWidth(j.children().eq(0),m[0]),k.append(j);for(y=r.find("thead").children("tr."+d.headerRow),f=0;x>f;f++)v.setWidth(y.children(":eq("+f+")"),m[f]);c.processTbody(s,k,!1)}(v.isFirefox||v.isOldIE)&&s.parent().css({width:C+w+z}),r.show()}},remove:function(c,e){var f=e.scroller_$container,g=c.namespace+"tsscroller";c.$table.off(g).insertBefore(f).find("thead").show().css("visibility","visible").children("tr."+d.headerRow).children().attr("tabindex",0).end().find("."+d.filterRow).show().removeClass(d.filterRowHide),f.remove(),a(b).off(g),c.isScrolling=!1}}}(jQuery,window);