/*! Widget: resizable - updated 3/25/2015 (v2.21.3) */ !function(a,b){"use strict";var c=a.tablesorter=a.tablesorter||{};a.extend(c.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"}),a(function(){var b="";a(b).appendTo("body")}),c.resizable={init:function(b,d){if(!b.$table.hasClass("hasResizable")){b.$table.addClass("hasResizable"),c.resizableReset(b.table,!0),d.resizable_={$wrap:b.$table.parent(),mouseXPosition:0,$target:null,$next:null,overflow:"auto"===b.$table.parent().css("overflow"),fullWidth:Math.abs(b.$table.parent().width()-b.$table.width())<20,storedSizes:[]};var e,f,g,h,i=parseInt(b.$table.css("margin-top"),10);for(d.resizable_.storedSizes=h=(c.storage&&d.resizable!==!1?c.storage(b.table,c.css.resizableStorage):[])||[],c.resizable.setWidths(b,d,h),d.$resizable_container=a('
').css({top:i}).insertBefore(b.$table),g=0;g').appendTo(d.$resizable_container).attr({"data-column":g,unselectable:"on"}).data("header",f).bind("selectstart",!1);b.$table.one("tablesorter-initialized",function(){c.resizable.setHandlePosition(b,d),c.resizable.bindings(this.config,this.config.widgetOptions)})}},setWidth:function(a,b){a.css({width:b,"min-width":"","max-width":""})},setWidths:function(b,d,e){var f,g=a(b.namespace+"_extra_headers"),h=b.$table.children("colgroup").children("col");if(e=e||d.resizable_.storedSizes||[],e.length){for(f=0;fe||e===g&&d.resizable_addLastColumn)&&c.css({height:f,left:i.position().left+i.width()-h})})},toggleTextSelection:function(b,d){var e=b.namespace+"tsresize";b.widgetOptions.resizable_.disabled=d,a("body").toggleClass(c.css.resizableNoSelect,d),d?a("body").attr("unselectable","on").bind("selectstart"+e,!1):a("body").removeAttr("unselectable").unbind("selectstart"+e)},bindings:function(d,e){var f=d.namespace+"tsresize";e.$resizable_container.children().bind("mousedown",function(b){var f,g=e.resizable_,h=a(d.namespace+"_extra_headers"),i=a(b.target).data("header");f=parseInt(i.attr("data-column"),10),g.$target=i=i.add(h.filter('[data-column="'+f+'"]')),g.target=f,g.$next=b.shiftKey||e.resizable_targetLast?i.parent().children().not(".resizable-false").filter(":last"):i.nextAll(":not(.resizable-false)").eq(0),f=parseInt(g.$next.attr("data-column"),10),g.$next=g.$next.add(h.filter('[data-column="'+f+'"]')),g.next=f,g.mouseXPosition=b.pageX,g.storedSizes=d.$headers.map(function(){return a(this).width()}).get(),c.resizable.toggleTextSelection(d,!0)}),a(document).bind("mousemove"+f,function(a){var b=e.resizable_;b.disabled&&0!==b.mouseXPosition&&b.$target&&(e.resizable_throttle?(clearTimeout(b.timer),b.timer=setTimeout(function(){c.resizable.mouseMove(d,e,a)},isNaN(e.resizable_throttle)?5:e.resizable_throttle)):c.resizable.mouseMove(d,e,a))}).bind("mouseup"+f,function(){e.resizable_.disabled&&(c.resizable.toggleTextSelection(d,!1),c.resizable.stopResize(d,e),c.resizable.setHandlePosition(d,e))}),a(b).bind("resize"+f+" resizeEnd"+f,function(){c.resizable.setHandlePosition(d,e)}),d.$table.find("thead:first").add(a(d.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+f,function(){var a=0===e.resizable_.storedSizes.length;return c.resizableReset(d.table),c.resizable.setHandlePosition(d,e),e.resizable_.storedSizes=[],a})},mouseMove:function(b,d,e){if(0!==d.resizable_.mouseXPosition&&d.resizable_.$target){{var f=d.resizable_,g=f.$target,h=f.$next,i=e.pageX-f.mouseXPosition;g.width()}f.fullWidth?(f.storedSizes[f.target]+=i,f.storedSizes[f.next]-=i,c.resizable.setWidths(b,d)):f.overflow?(b.$table.add(a(b.namespace+"_extra_table")).width(function(a,b){return b+i}),h.length||(f.$wrap[0].scrollLeft=b.$table.width())):(f.storedSizes[f.target]+=i,c.resizable.setWidths(b,d)),f.mouseXPosition=e.pageX}},stopResize:function(d,e){var f=e.resizable_;f.storedSizes=[],c.storage&&(f.storedSizes=d.$headers.map(function(){return a(this).width()}).get(),e.resizable!==!1&&c.storage(d.table,c.css.resizableStorage,f.storedSizes)),f.mouseXPosition=0,f.$target=f.$next=null,a(b).trigger("resize")}},c.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1,resizable_widths:[],resizable_throttle:!1,resizable_targetLast:!1},init:function(a,b,d,e){c.resizable.init(d,e)},remove:function(b,d,e){if(e.$resizable_container){var f=d.namespace+"tsresize";d.$table.add(a(d.namespace+"_extra_table")).removeClass("hasResizable").children("thead").unbind("contextmenu"+f),e.$resizable_container.remove(),c.resizable.toggleTextSelection(d,!1),c.resizableReset(b),a(document).unbind("mousemove"+f+" mouseup"+f)}}}),c.resizableReset=function(d,e){a(d).each(function(){var f,g=this.config,h=g&&g.widgetOptions;d&&g&&(g.$headers.each(function(b){f=a(this),h.resizable_widths&&h.resizable_widths[b]?f.css("width",h.resizable_widths[b]):f.hasClass("resizable-false")||f.css("width","")}),a(b).trigger("resize"),c.storage&&!e&&c.storage(this,c.css.resizableStorage,{}))})}}(jQuery,window);