1/*! Bootstrap integration for DataTables' Buttons 2 * © SpryMedia Ltd - datatables.net/license 3 */ 4 5(function( factory ){ 6 if ( typeof define === 'function' && define.amd ) { 7 // AMD 8 define( ['jquery', 'datatables.net-se', 'datatables.net-buttons'], function ( $ ) { 9 return factory( $, window, document ); 10 } ); 11 } 12 else if ( typeof exports === 'object' ) { 13 // CommonJS 14 var jq = require('jquery'); 15 var cjsRequires = function (root, $) { 16 if ( ! $.fn.dataTable ) { 17 require('datatables.net-se')(root, $); 18 } 19 20 if ( ! $.fn.dataTable.Buttons ) { 21 require('datatables.net-buttons')(root, $); 22 } 23 }; 24 25 if (typeof window === 'undefined') { 26 module.exports = function (root, $) { 27 if ( ! root ) { 28 // CommonJS environments without a window global must pass a 29 // root. This will give an error otherwise 30 root = window; 31 } 32 33 if ( ! $ ) { 34 $ = jq( root ); 35 } 36 37 cjsRequires( root, $ ); 38 return factory( $, root, root.document ); 39 }; 40 } 41 else { 42 cjsRequires( window, jq ); 43 module.exports = factory( jq, window, window.document ); 44 } 45 } 46 else { 47 // Browser 48 factory( jQuery, window, document ); 49 } 50}(function( $, window, document, undefined ) { 51'use strict'; 52var DataTable = $.fn.dataTable; 53 54 55 56$.extend(true, DataTable.Buttons.defaults, { 57 dom: { 58 container: { 59 className: 'dt-buttons ui buttons' 60 }, 61 button: { 62 tag: 'button', 63 active: 'active', 64 className: 'dt-button ui button', 65 spacerClass: 'dt-button ui button' 66 }, 67 collection: { 68 action: { 69 dropHtml: '<i class="dropdown icon"></i>' 70 }, 71 container: { 72 tag: 'div', 73 className: 'ui dropdown active visible dt-button-collection', 74 content: { 75 className: 'menu transition visible' 76 } 77 }, 78 closeButton: false, 79 button: { 80 tag: 'div', 81 className: 'item', 82 active: 'dt-button-active', 83 spacer: { 84 className: 'divider', 85 tag: 'div' 86 } 87 }, 88 split: { 89 action: { 90 tag: 'div', 91 className: '' 92 }, 93 dropdown: { 94 tag: 'span', 95 className: 'dt-button-split-drop dropdown icon', 96 dropHtml: '<i class="dropdown icon"></i>' 97 }, 98 wrapper: { 99 tag: 'div', 100 className: 'dt-button-split' 101 } 102 } 103 }, 104 split: { 105 action: { 106 tag: 'button', 107 className: 'dt-button-split-drop-button ui button' 108 }, 109 dropdown: { 110 tag: 'button', 111 className: 'ui floating button dt-button-split-drop dropdown icon' 112 }, 113 wrapper: { 114 tag: 'div', 115 className: 'dt-button-split buttons' 116 } 117 } 118 } 119}); 120 121$(document).on('buttons-popover.dt', function () { 122 var notButton = false; 123 $('.dtsp-panesContainer').each(function () { 124 if (!$(this).is('button')) { 125 notButton = true; 126 } 127 }); 128 if (notButton) { 129 $('.dtsp-panesContainer').removeClass('vertical buttons'); 130 } 131}); 132 133 134return DataTable; 135})); 136