datatables.net-scroller
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -1,2 +0,2 @@ | ||
/*! Scroller 1.3.0 | ||
/*! Scroller 1.4.0 | ||
* ©2011-2015 SpryMedia Ltd - datatables.net/license | ||
@@ -8,3 +8,3 @@ */ | ||
* @description Virtual rendering for DataTables | ||
* @version 1.3.0 | ||
* @version 1.4.0 | ||
* @file dataTables.scroller.js | ||
@@ -25,8 +25,32 @@ * @author SpryMedia Ltd (www.sprymedia.co.uk) | ||
(function(window, document, undefined){ | ||
(function( factory ){ | ||
if ( typeof define === 'function' && define.amd ) { | ||
// AMD | ||
define( ['jquery', 'datatables.net'], function ( $ ) { | ||
return factory( $, window, document ); | ||
} ); | ||
} | ||
else if ( typeof exports === 'object' ) { | ||
// CommonJS | ||
module.exports = function (root, $) { | ||
if ( ! root ) { | ||
root = window; | ||
} | ||
if ( ! $ || ! $.fn.dataTable ) { | ||
$ = require('datatables.net')(root, $).$; | ||
} | ||
var factory = function( $, DataTable ) { | ||
"use strict"; | ||
return factory( $, root, root.document ); | ||
}; | ||
} | ||
else { | ||
// Browser | ||
factory( jQuery, window, document ); | ||
} | ||
}(function( $, window, document, undefined ) { | ||
'use strict'; | ||
var DataTable = $.fn.dataTable; | ||
/** | ||
@@ -228,3 +252,3 @@ * Scroller is a virtual rendering plug-in for DataTables which allows large | ||
Scroller.prototype = /** @lends Scroller.prototype */{ | ||
$.extend( Scroller.prototype, { | ||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | ||
@@ -419,3 +443,3 @@ * Public methods | ||
{ | ||
this.s.dt.oInstance.fnDraw(); | ||
this.s.dt.oInstance.fnDraw( false ); | ||
} | ||
@@ -694,10 +718,3 @@ }, | ||
if ( heights.virtual === heights.scroll ) { | ||
coeff = (heights.virtual-heights.viewport) / (heights.scroll-heights.viewport); | ||
if ( dir === 'virtualToPhysical' ) { | ||
return val / coeff; | ||
} | ||
else if ( dir === 'physicalToVirtual' ) { | ||
return val * coeff; | ||
} | ||
return val; | ||
} | ||
@@ -1011,3 +1028,3 @@ | ||
} | ||
}; | ||
} ); | ||
@@ -1165,3 +1182,3 @@ | ||
*/ | ||
Scroller.version = "1.3.0"; | ||
Scroller.version = "1.4.0"; | ||
@@ -1287,20 +1304,2 @@ | ||
return Scroller; | ||
}; // /factory | ||
// Define as an AMD module if possible | ||
if ( typeof define === 'function' && define.amd ) { | ||
define( ['jquery', 'datatables'], factory ); | ||
} | ||
else if ( typeof exports === 'object' ) { | ||
// Node/CommonJS | ||
factory( require('jquery'), require('datatables') ); | ||
} | ||
else if ( jQuery && !jQuery.fn.dataTable.Scroller ) { | ||
// Otherwise simply initialise as normal, stopping multiple evaluation | ||
factory( jQuery, jQuery.fn.dataTable ); | ||
} | ||
})(window, document); | ||
})); |
{ | ||
"name": "datatables.net-scroller", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Scroller for DataTables ", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -22,3 +22,3 @@ # Scroller for DataTables | ||
var $ = require( 'jquery' ); | ||
require( 'datatables.net-scroller' )( $ ); | ||
require( 'datatables.net-scroller' )( window, $ ); | ||
``` | ||
@@ -25,0 +25,0 @@ |
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
1132
42025