1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-12-01 13:24:10 +01:00

New: CommonJS support

- This fixes DataTables/DataTables #299
This commit is contained in:
Allan Jardine 2014-04-11 09:11:13 +01:00
parent 56e6f38911
commit 0ea30f9ba7
2 changed files with 9 additions and 9 deletions

View File

@ -1 +1 @@
d77140b845220c2ced4db9d3ce0f768958eb7132
6e99739abf4582b8630d972c006d66572db4bff7

View File

@ -29,16 +29,16 @@
(function( factory ) {
"use strict";
// Define as an AMD module if possible
if ( typeof define === 'function' && define.amd )
{
if ( typeof define === 'function' && define.amd ) {
// Define as an AMD module if possible
define( 'datatables', ['jquery'], factory );
}
/* Define using browser globals otherwise
* Prevent multiple instantiations if the script is loaded twice
*/
else if ( jQuery && !jQuery.fn.dataTable )
{
else if ( typeof exports === 'object' ) {
// Node/CommonJS
}
else if ( jQuery && !jQuery.fn.dataTable ) {
// Define using browser globals otherwise
// Prevent multiple instantiations if the script is loaded twice
factory( jQuery );
}
}