|
1 |
| -/*! Checkboxes 1.1.1 |
| 1 | +/*! Checkboxes 1.1.2 |
2 | 2 | * Copyright (c) Gyrocode (www.gyrocode.com)
|
3 | 3 | * License: MIT License
|
4 | 4 | */
|
5 | 5 |
|
6 | 6 | /**
|
7 | 7 | * @summary Checkboxes
|
8 | 8 | * @description Checkboxes extension for jQuery DataTables
|
9 |
| - * @version 1.1.1 |
| 9 | + * @version 1.1.2 |
10 | 10 | * @file dataTables.checkboxes.js
|
11 | 11 | * @author Gyrocode (http://www.gyrocode.com/projects/jquery-datatables-checkboxes/)
|
12 | 12 | * @contact http://www.gyrocode.com/contacts
|
13 | 13 | * @copyright Copyright (c) Gyrocode
|
14 | 14 | * @license MIT License
|
15 | 15 | */
|
16 | 16 |
|
17 |
| -(function(window, document, undefined) { |
| 17 | +(function( factory ){ |
| 18 | + if ( typeof define === 'function' && define.amd ) { |
| 19 | + // AMD |
| 20 | + define( ['jquery', 'datatables.net'], function ( $ ) { |
| 21 | + return factory( $, window, document ); |
| 22 | + } ); |
| 23 | + } |
| 24 | + else if ( typeof exports === 'object' ) { |
| 25 | + // CommonJS |
| 26 | + module.exports = function (root, $) { |
| 27 | + if ( ! root ) { |
| 28 | + root = window; |
| 29 | + } |
18 | 30 |
|
| 31 | + if ( ! $ || ! $.fn.dataTable ) { |
| 32 | + $ = require('datatables.net')(root, $).$; |
| 33 | + } |
19 | 34 |
|
20 |
| -var factory = function( $, DataTable ) { |
21 |
| -"use strict"; |
| 35 | + return factory( $, root, root.document ); |
| 36 | + }; |
| 37 | + } |
| 38 | + else { |
| 39 | + // Browser |
| 40 | + factory( jQuery, window, document ); |
| 41 | + } |
| 42 | +}(function( $, window, document, undefined ) { |
| 43 | +'use strict'; |
| 44 | +var DataTable = $.fn.dataTable; |
| 45 | + |
22 | 46 |
|
23 | 47 | /**
|
24 | 48 | * Checkboxes is an extension for the jQuery DataTables library that provides
|
@@ -811,22 +835,6 @@ $(document).on( 'preInit.dt.dtr', function (e, settings, json) {
|
811 | 835 | new Checkboxes( settings );
|
812 | 836 | } );
|
813 | 837 |
|
814 |
| -return Checkboxes; |
815 |
| -}; // /factory |
816 |
| - |
817 |
| - |
818 |
| -// Define as an AMD module if possible |
819 |
| -if ( typeof define === 'function' && define.amd ) { |
820 |
| - define( ['jquery', 'datatables'], factory ); |
821 |
| -} |
822 |
| -else if ( typeof exports === 'object' ) { |
823 |
| - // Node/CommonJS |
824 |
| - factory( require('jquery'), require('datatables') ); |
825 |
| -} |
826 |
| -else if ( jQuery && !jQuery.fn.dataTable.Checkboxes ) { |
827 |
| - // Otherwise simply initialise as normal, stopping multiple evaluation |
828 |
| - factory( jQuery, jQuery.fn.dataTable ); |
829 |
| -} |
830 | 838 |
|
831 |
| - |
832 |
| -})(window, document); |
| 839 | +return Checkboxes; |
| 840 | +})); |
0 commit comments