1/*! Foundation 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-zf', '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-zf')(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 tag: 'div', 60 className: 'dt-buttons button-group' 61 }, 62 button: { 63 tag: 'a', 64 className: 'dt-button button small', 65 active: 'secondary active' 66 }, 67 collection: { 68 action: { 69 dropHtml: '' 70 }, 71 button: { 72 tag: 'li', 73 className: '', 74 active: 'dt-button-active-a', 75 liner: { 76 tag: 'a' 77 } 78 }, 79 container: { 80 tag: 'div', 81 className: 'dt-button-collection', 82 content: { 83 tag: 'ul', 84 className: 'dropdown menu is-dropdown-submenu' 85 } 86 } 87 }, 88 split: { 89 action: { 90 tag: 'button', 91 className: 'button small' 92 }, 93 dropdown: { 94 tag: 'button', 95 className: 'button dropdown arrow-only', 96 dropHtml: '' 97 }, 98 wrapper: { 99 tag: 'div', 100 className: 'button-group dt-button-split' 101 } 102 } 103 } 104}); 105 106DataTable.ext.buttons.collection.className = 'dropdown'; 107 108$(document).on('buttons-popover.dt', function () { 109 var notButton = false; 110 $('.dtsp-panesContainer').each(function () { 111 if (!$(this).is('button')) { 112 notButton = true; 113 } 114 }); 115 if (notButton) { 116 $('.dtsp-panesContainer').removeClass('button-group stacked'); 117 } 118}); 119 120 121return DataTable; 122})); 123