/*! Copyright (C) 2011 T. Connell & Associates, Inc. Dual-licensed under the MIT and GPL licenses THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Resizable scroller widget for the jQuery tablesorter plugin Version 2.0 - modified by Rob Garrison 4/12/2013; updated 3/5/2015 (v2.21.0) Requires jQuery v1.7+ Requires the tablesorter plugin, v2.8+, available at http://mottie.github.com/tablesorter/docs/ Usage: $(function() { $('table.tablesorter').tablesorter({ widgets: ['zebra', 'scroller'], widgetOptions : { scroller_height : 300, // height of scroll window scroller_barWidth : 18, // scroll bar width scroller_jumpToHeader : true, // header snap to browser top when scrolling the tbody } }); }); Website: www.tconnell.com */ !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="";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=e.namespace.slice(1)+"tsscroller",q=a(b),r=e.$table;e.isScrolling||(e.widthFixed=!0,g=f.scroller_height||300,h=r.children("tbody").height(),0!==h&&g>h&&(g=h+10),i=a(''+r.children("thead")[0].outerHTML+"
"),j=r.children("tfoot"),j.length&&(o=a('
').append(j.clone(!0)).append(r.children("thead")[0].outerHTML).wrap('