LaravelTest
87 строк · 2.0 Кб
1/*! Bootstrap integration for DataTables' Buttons
2* ©2016 SpryMedia Ltd - datatables.net/license
3*/
4
5(function( factory ){6if ( typeof define === 'function' && define.amd ) {7// AMD8define( ['jquery', 'datatables.net-bs4', 'datatables.net-buttons'], function ( $ ) {9return factory( $, window, document );10} );11}12else if ( typeof exports === 'object' ) {13// CommonJS14module.exports = function (root, $) {15if ( ! root ) {16root = window;17}18
19if ( ! $ || ! $.fn.dataTable ) {20$ = require('datatables.net-bs4')(root, $).$;21}22
23if ( ! $.fn.dataTable.Buttons ) {24require('datatables.net-buttons')(root, $);25}26
27return factory( $, root, root.document );28};29}30else {31// Browser32factory( jQuery, window, document );33}34}(function( $, window, document, undefined ) {35'use strict';36var DataTable = $.fn.dataTable;37
38$.extend( true, DataTable.Buttons.defaults, {39dom: {40container: {41className: 'dt-buttons btn-group flex-wrap'42},43button: {44className: 'btn btn-secondary'45},46collection: {47tag: 'div',48className: 'dropdown-menu',49closeButton: false,50button: {51tag: 'a',52className: 'dt-button dropdown-item',53active: 'active',54disabled: 'disabled'55}56},57splitWrapper: {58tag: 'div',59className: 'dt-btn-split-wrapper btn-group',60closeButton: false,61},62splitDropdown: {63tag: 'button',64text: '',65className: 'btn btn-secondary dt-btn-split-drop dropdown-toggle dropdown-toggle-split',66closeButton: false,67align: 'split-left',68splitAlignClass: 'dt-button-split-left'69},70splitDropdownButton: {71tag: 'button',72className: 'dt-btn-split-drop-button btn btn-secondary',73closeButton: false74}75},76buttonCreated: function ( config, button ) {77return config.buttons ?78$('<div class="btn-group"/>').append(button) :79button;80}81} );82
83DataTable.ext.buttons.collection.className += ' dropdown-toggle';84DataTable.ext.buttons.collection.rightAlignClassName = 'dropdown-menu-right';85
86return DataTable.Buttons;87}));88