6
if ( typeof define === 'function' && define.amd ) {
8
define( ['jquery', 'datatables.net-bs4', 'datatables.net-buttons'], function ( $ ) {
9
return factory( $, window, document );
12
else if ( typeof exports === 'object' ) {
14
module.exports = function (root, $) {
19
if ( ! $ || ! $.fn.dataTable ) {
20
$ = require('datatables.net-bs4')(root, $).$;
23
if ( ! $.fn.dataTable.Buttons ) {
24
require('datatables.net-buttons')(root, $);
27
return factory( $, root, root.document );
32
factory( jQuery, window, document );
34
}(function( $, window, document, undefined ) {
36
var DataTable = $.fn.dataTable;
38
$.extend( true, DataTable.Buttons.defaults, {
41
className: 'dt-buttons btn-group flex-wrap'
44
className: 'btn btn-secondary'
48
className: 'dropdown-menu',
52
className: 'dt-button dropdown-item',
59
className: 'dt-btn-split-wrapper btn-group',
65
className: 'btn btn-secondary dt-btn-split-drop dropdown-toggle dropdown-toggle-split',
68
splitAlignClass: 'dt-button-split-left'
70
splitDropdownButton: {
72
className: 'dt-btn-split-drop-button btn btn-secondary',
76
buttonCreated: function ( config, button ) {
77
return config.buttons ?
78
$('<div class="btn-group"/>').append(button) :
83
DataTable.ext.buttons.collection.className += ' dropdown-toggle';
84
DataTable.ext.buttons.collection.rightAlignClassName = 'dropdown-menu-right';
86
return DataTable.Buttons;