提交 | 用户 | 时间
|
58d006
|
1 |
/*! jQuery UI integration for DataTables' Buttons |
A |
2 |
* ©2015 SpryMedia Ltd - datatables.net/license |
|
3 |
*/ |
|
4 |
|
|
5 |
(function( factory ){ |
|
6 |
if ( typeof define === 'function' && define.amd ) { |
|
7 |
// AMD |
|
8 |
define( ['jquery', 'datatables.net-jqui', 'datatables.net-buttons'], function ( $ ) { |
|
9 |
return factory( $, window, document ); |
|
10 |
} ); |
|
11 |
} |
|
12 |
else if ( typeof exports === 'object' ) { |
|
13 |
// CommonJS |
|
14 |
module.exports = function (root, $) { |
|
15 |
if ( ! root ) { |
|
16 |
root = window; |
|
17 |
} |
|
18 |
|
|
19 |
if ( ! $ || ! $.fn.dataTable ) { |
|
20 |
$ = require('datatables.net-jqui')(root, $).$; |
|
21 |
} |
|
22 |
|
|
23 |
if ( ! $.fn.dataTable.Buttons ) { |
|
24 |
require('datatables.net-buttons')(root, $); |
|
25 |
} |
|
26 |
|
|
27 |
return factory( $, root, root.document ); |
|
28 |
}; |
|
29 |
} |
|
30 |
else { |
|
31 |
// Browser |
|
32 |
factory( jQuery, window, document ); |
|
33 |
} |
|
34 |
}(function( $, window, document, undefined ) { |
|
35 |
'use strict'; |
|
36 |
var DataTable = $.fn.dataTable; |
|
37 |
|
|
38 |
|
|
39 |
$.extend( true, DataTable.Buttons.defaults, { |
|
40 |
dom: { |
|
41 |
container: { |
|
42 |
className: 'dt-buttons ui-buttonset' |
|
43 |
}, |
|
44 |
button: { |
|
45 |
className: 'dt-button ui-button ui-state-default ui-button-text-only', |
|
46 |
disabled: 'ui-state-disabled', |
|
47 |
active: 'ui-state-active' |
|
48 |
}, |
|
49 |
buttonLiner: { |
|
50 |
tag: 'span', |
|
51 |
className: 'ui-button-text' |
|
52 |
} |
|
53 |
} |
|
54 |
} ); |
|
55 |
|
|
56 |
DataTable.ext.buttons.collection.text = function ( dt ) { |
|
57 |
return dt.i18n('buttons.collection', 'Collection <span class="ui-button-icon-primary ui-icon ui-icon-triangle-1-s"/>'); |
|
58 |
}; |
|
59 |
|
|
60 |
|
|
61 |
return DataTable.Buttons; |
|
62 |
})); |