tablesorter/dist/js/widgets/widget-scroller.min.js

2 lines
15 KiB
JavaScript
Raw Normal View History

2018-03-18 13:49:07 +00:00
/*! Widget: scroller - updated 2018-02-25 (v2.29.6) */
!function(e,r){"use strict";var l=e.tablesorter,o=l.css;e.extend(l.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",scrollerHideColumn:"tablesorter-scroller-hidden-column",scrollerHideElement:"tablesorter-scroller-hidden",scrollerSpacerRow:"tablesorter-scroller-spacer",scrollerBarSpacer:"tablesorter-scroller-bar-spacer",scrollerAddedHeight:"tablesorter-scroller-added-height",scrollerHack:"tablesorter-scroller-scrollbar-hack",scrollerRtl:"ts-scroller-rtl"}),l.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(e,r,o){r.isScrolling?l.scroller.resize(r,o):l.scroller.setup(r,o)},remove:function(e,r,o){l.scroller.remove(r,o)}}),l.window_resize=function(){l.timer_resize&&clearTimeout(l.timer_resize),l.timer_resize=setTimeout(function(){e(r).trigger("resizeEnd")},250)},e(function(){var r="<style>."+o.scrollerWrap+" { position: relative; overflow: hidden; }."+o.scrollerWrap+" * { box-sizing: border-box; }."+o.scrollerHeader+", ."+o.scrollerFooter+" { position: relative; overflow: hidden; }."+o.scrollerHeader+" table."+o.table+" { margin-bottom: 0; }."+o.scrollerTable+" { position: relative; overflow: auto; }."+o.scrollerTable+" table."+o.table+" { border-top: 0; margin-top: 0; margin-bottom: 0; overflow: hidden; max-width: initial; }."+o.scrollerTable+" tfoot, ."+o.scrollerHideElement+", ."+o.scrollerHideColumn+" { display: none; }."+o.scrollerFixed+", ."+o.scrollerFixed+" ."+o.scrollerFixedPanel+" { pointer-events: none; }."+o.scrollerFixed+" > div { pointer-events: all; }."+o.scrollerWrap+" ."+o.scrollerFixed+" { position: absolute; top: 0; z-index: 1; left: 0 } ."+o.scrollerWrap+" ."+o.scrollerFixed+"."+o.scrollerRtl+" { left: auto; right: 0 } ."+o.scrollerWrap+"."+o.scrollerHasFix+" > ."+o.scrollerTable+" { overflow: auto; }."+o.scrollerFixed+" ."+o.scrollerFooter+" { position: absolute; bottom: 0; }."+o.scrollerFixed+" ."+o.scrollerTable+" { position: relative; left: 0; overflow: auto; -ms-overflow-style: none; }."+o.scrollerFixed+" ."+o.scrollerTable+"::-webkit-scrollbar { display: none; }."+o.scrollerWrap+" ."+o.scrollerFixedPanel+" { position: absolute; top: 0; bottom: 0; z-index: 2; left: 0; right: 0; } </style>";e("head").append(r)}),l.scroller={isFirefox:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isOldIE:document.all&&!r.atob,isIE:document.all&&!r.atob||navigator.appVersion.indexOf("Trident/")>0,isSafari:navigator.userAgent.toLowerCase().indexOf("safari")>-1&&-1===navigator.userAgent.toLowerCase().indexOf("chrome"),hasScrollBar:function(e,r){return r?e.get(0).scrollWidth>e.width():e.get(0).scrollHeight>e.height()},setWidth:function(e,r){e.css({width:r,"min-width":r,"max-width":r})},getBarWidth:function(){var r=e("<div>").css({position:"absolute",top:"-9999px",left:0,width:"100px",height:"100px",overflow:"scroll",visibility:"hidden"}).appendTo("body"),l=r[0],o=l.offsetWidth-l.clientWidth;return r.remove(),o},setup:function(s,t){var i,d,a,c,n,h,f,p,b=e(r),u=l.scroller,m=s.namespace+"tsscroller",g=e(),v=s.namespace.slice(1)+"tsscroller",x=s.$table;s.widthFixed=!0,t.scroller_calcWidths=[],t.scroller_saved=[0,0],t.scroller_isBusy=!0,null!==t.scroller_barWidth?t.scroller_barSetWidth=t.scroller_barWidth:(p=u.getBarWidth(),t.scroller_barSetWidth=null!==p?p:15),f=x.children("caption"),d=e('<table class="'+x.attr("class")+'" cellpadding=0 cellspacing=0>'+(f.length?f[0].outerHTML:"")+x.children("thead")[0].outerHTML+"</table>"),t.scroller_$header=d.addClass(s.namespace.slice(1)+"_extra_table"),(a=x.children("tfoot")).length&&(g=e('<table class="'+x.attr("class")+'" cellpadding=0 cellspacing=0 style="margin-top:0"></table>').addClass(s.namespace.slice(1)+"_extra