/*! Foundation integration for DataTables' Editor * ©2015 SpryMedia Ltd - datatables.net/license */ (function( factory ){ if ( typeof define === 'function' && define.amd ) { // AMD define( ['jquery', 'datatables.net-zf', 'datatables.net-editor'], function ( $ ) { return factory( $, window, document ); } ); } else if ( typeof exports === 'object' ) { // CommonJS module.exports = function (root, $) { if ( ! root ) { // CommonJS environments without a window global must pass a // root. This will give an error otherwise root = window; } if ( ! $ ) { $ = typeof window !== 'undefined' ? // jQuery's factory checks for a global window require('jquery') : require('jquery')( root ); } if ( ! $.fn.dataTable ) { require('datatables.net-zf')(root, $); } if ( ! $.fn.dataTable ) { require('datatables.net-editor')(root, $); } return factory( $, root, root.document ); }; } else { // Browser factory( jQuery, window, document ); } }(function( $, window, document, undefined ) { 'use strict'; var DataTable = $.fn.dataTable; (function( factory ){ if ( typeof define === 'function' && define.amd ) { // AMD define( ['jquery', 'datatables.net-zf', 'datatables.net-editor'], function ( $ ) { return factory( $, window, document ); } ); } else if ( typeof exports === 'object' ) { // CommonJS module.exports = function (root, $) { if ( ! root ) { root = window; } if ( ! $ || ! $.fn.dataTable ) { $ = require('datatables.net-zf')(root, $).$; } if ( ! $.fn.dataTable.Editor ) { require('datatables.net-editor')(root, $); } return factory( $, root, root.document ); }; } else { // Browser factory( jQuery, window, document ); } }(function( $, window, document, undefined ) { 'use strict'; var DataTable = $.fn.dataTable; /* * Set the default display controller to be our foundation control */ DataTable.Editor.defaults.display = "foundation"; /* * Change the default classes from Editor to be classes for Foundation */ $.extend( true, $.fn.dataTable.Editor.classes, { field: { wrapper: "DTE_Field row", label: "small-4 columns inline", input: "small-8 columns", error: "error", multiValue: "panel radius multi-value", multiInfo: "small", multiRestore: "panel radius multi-restore", "msg-labelInfo": "label secondary", "msg-info": "label secondary", "msg-message": "label secondary", "msg-error": "label alert" }, form: { button: "button small", buttonInternal: "button small" } } ); /* * Foundation display controller - this is effectively a proxy to the Foundation * modal control. */ var shown = false; var reveal; const dom = { content: $( '
' ), close: $('