datatables.net-scroller
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -1,2 +0,2 @@ | ||
/*! Scroller 2.0.2 | ||
/*! Scroller 2.0.3 | ||
* ©2011-2020 SpryMedia Ltd - datatables.net/license | ||
@@ -8,3 +8,3 @@ */ | ||
* @description Virtual rendering for DataTables | ||
* @version 2.0.2 | ||
* @version 2.0.3 | ||
* @file dataTables.scroller.js | ||
@@ -531,3 +531,3 @@ * @author SpryMedia Ltd (www.sprymedia.co.uk) | ||
dt.on( 'stateSaveParams.scroller', function ( e, settings, data ) { | ||
if ( initialStateSave ) { | ||
if ( initialStateSave && loadedState ) { | ||
data.scroller = loadedState.scroller; | ||
@@ -1196,3 +1196,3 @@ initialStateSave = false; | ||
*/ | ||
Scroller.version = "2.0.2"; | ||
Scroller.version = "2.0.3"; | ||
@@ -1199,0 +1199,0 @@ |
/*! | ||
Scroller 2.0.2 | ||
Scroller 2.0.3 | ||
©2011-2020 SpryMedia Ltd - datatables.net/license | ||
@@ -13,3 +13,3 @@ */ | ||
this.s.heights.row&&"auto"!=this.s.heights.row&&(this.s.autoHeight=!1);this.s.ingnoreScroll=!0;e(this.dom.scroller).on("scroll.dt-scroller",function(){a._scroll.call(a)});e(this.dom.scroller).on("touchstart.dt-scroller",function(){a._scroll.call(a)});e(this.dom.scroller).on("mousedown.dt-scroller",function(){a.s.mousedown=true}).on("mouseup.dt-scroller",function(){a.s.labelVisible=false;a.s.mousedown=false;a.dom.label.css("display","none")});e(g).on("resize.dt-scroller",function(){a.measure(false); | ||
a._info()});var c=!0,d=b.state.loaded();b.on("stateSaveParams.scroller",function(b,e,g){if(c){g.scroller=d.scroller;c=false}else g.scroller={topRow:a.s.topRowFloat,baseScrollTop:a.s.baseScrollTop,baseRowTop:a.s.baseRowTop,scrollTop:a.s.lastScrollTop}});d&&d.scroller&&(this.s.topRowFloat=d.scroller.topRow,this.s.baseScrollTop=d.scroller.baseScrollTop,this.s.baseRowTop=d.scroller.baseRowTop);this.measure(!1);a.s.stateSaveThrottle=a.s.dt.oApi._fnThrottle(function(){a.s.dtApi.state.save()},500);b.on("init.scroller", | ||
a._info()});var c=!0,d=b.state.loaded();b.on("stateSaveParams.scroller",function(b,e,g){if(c&&d){g.scroller=d.scroller;c=false}else g.scroller={topRow:a.s.topRowFloat,baseScrollTop:a.s.baseScrollTop,baseRowTop:a.s.baseRowTop,scrollTop:a.s.lastScrollTop}});d&&d.scroller&&(this.s.topRowFloat=d.scroller.topRow,this.s.baseScrollTop=d.scroller.baseScrollTop,this.s.baseRowTop=d.scroller.baseRowTop);this.measure(!1);a.s.stateSaveThrottle=a.s.dt.oApi._fnThrottle(function(){a.s.dtApi.state.save()},500);b.on("init.scroller", | ||
function(){a.measure(false);a.s.scrollType="jump";a._draw();b.on("draw.scroller",function(){a._draw()})});b.on("preDraw.dt.scroller",function(){a._scrollForce()});b.on("destroy.scroller",function(){e(g).off("resize.dt-scroller");e(a.dom.scroller).off(".dt-scroller");e(a.s.dt.nTable).off(".scroller");e(a.s.dt.nTableWrapper).removeClass("DTS");e("div.DTS_Loading",a.dom.scroller.parentNode).remove();a.dom.table.style.position="";a.dom.table.style.top="";a.dom.table.style.left=""})}else this.s.dt.oApi._fnLog(this.s.dt, | ||
@@ -27,4 +27,4 @@ 0,"Pagination must be enabled for Scroller")},_calcRowHeight:function(){var a=this.s.dt,b=a.nTable,c=b.cloneNode(!1),d=e("<tbody/>").appendTo(c),f=e('<div class="'+a.oClasses.sWrapper+' DTS"><div class="'+a.oClasses.sScrollWrapper+'"><div class="'+a.oClasses.sScrollBody+'"></div></div></div>');e("tbody tr:lt(4)",b).clone().appendTo(d);var k=e("tr",d).length;if(1===k)d.prepend("<tr><td> </td></tr>"),d.append("<tr><td> </td></tr>");else for(;3>k;k++)d.append("<tr><td> </td></tr>");e("div."+ | ||
"block"),this.s.loaderVisible=!0}else this.s.topRowFloat=this.pixelsToRow(c,!1,!0);this.s.lastScrollTop=c;this.s.stateSaveThrottle();"jump"===this.s.scrollType&&this.s.mousedown&&(this.s.labelVisible=!0);this.s.labelVisible&&this.dom.label.html(this.s.dt.fnFormatNumber(parseInt(this.s.topRowFloat,10)+1)).css("top",c+c*b.labelFactor).css("display","block")}},_scrollForce:function(){var a=this.s.heights;a.virtual=a.row*this.s.dt.fnRecordsDisplay();a.scroll=a.virtual;1E6<a.scroll&&(a.scroll=1E6);this.dom.force.style.height= | ||
a.scroll>this.s.heights.row?a.scroll+"px":this.s.heights.row+"px"}});h.defaults={boundaryScale:0.5,displayBuffer:9,loadingIndicator:!1,rowHeight:"auto",serverWait:200};h.oDefaults=h.defaults;h.version="2.0.2";e(i).on("preInit.dt.dtscroller",function(a,b){if("dt"===a.namespace){var c=b.oInit.scroller,d=m.defaults.scroller;if(c||d)d=e.extend({},c,d),!1!==c&&new h(b,d)}});e.fn.dataTable.Scroller=h;e.fn.DataTable.Scroller=h;var j=e.fn.dataTable.Api;j.register("scroller()",function(){return this});j.register("scroller().rowToPixels()", | ||
a.scroll>this.s.heights.row?a.scroll+"px":this.s.heights.row+"px"}});h.defaults={boundaryScale:0.5,displayBuffer:9,loadingIndicator:!1,rowHeight:"auto",serverWait:200};h.oDefaults=h.defaults;h.version="2.0.3";e(i).on("preInit.dt.dtscroller",function(a,b){if("dt"===a.namespace){var c=b.oInit.scroller,d=m.defaults.scroller;if(c||d)d=e.extend({},c,d),!1!==c&&new h(b,d)}});e.fn.dataTable.Scroller=h;e.fn.DataTable.Scroller=h;var j=e.fn.dataTable.Api;j.register("scroller()",function(){return this});j.register("scroller().rowToPixels()", | ||
function(a,b,c){var d=this.context;if(d.length&&d[0].oScroller)return d[0].oScroller.rowToPixels(a,b,c)});j.register("scroller().pixelsToRow()",function(a,b,c){var d=this.context;if(d.length&&d[0].oScroller)return d[0].oScroller.pixelsToRow(a,b,c)});j.register(["scroller().scrollToRow()","scroller.toPosition()"],function(a,b){this.iterator("table",function(c){c.oScroller&&c.oScroller.scrollToRow(a,b)});return this});j.register("row().scrollTo()",function(a){var b=this;this.iterator("row",function(c, | ||
d){if(c.oScroller){var e=b.rows({order:"applied",search:"applied"}).indexes().indexOf(d);c.oScroller.scrollToRow(e,a)}});return this});j.register("scroller.measure()",function(a){this.iterator("table",function(b){b.oScroller&&b.oScroller.measure(a)});return this});j.register("scroller.page()",function(){var a=this.context;if(a.length&&a[0].oScroller)return a[0].oScroller.pageInfo()});return h}); |
{ | ||
"name": "datatables.net-scroller", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Scroller for DataTables ", | ||
@@ -5,0 +5,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55281