6
if ( typeof define === 'function' && define.amd ) {
8
define( ['jquery', 'datatables.net-bs4', 'datatables.net-responsive'], 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.Responsive ) {
24
require('datatables.net-responsive')(root, $);
27
return factory( $, root, root.document );
32
factory( jQuery, window, document );
34
}(function( $, window, document, undefined ) {
36
var DataTable = $.fn.dataTable;
39
var _display = DataTable.Responsive.display;
40
var _original = _display.modal;
42
'<div class="modal fade dtr-bs-modal" role="dialog">'+
43
'<div class="modal-dialog" role="document">'+
44
'<div class="modal-content">'+
45
'<div class="modal-header">'+
46
'<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>'+
48
'<div class="modal-body"/>'+
54
_display.modal = function ( options ) {
55
return function ( row, update, render ) {
57
_original( row, update, render );
61
if ( options && options.header ) {
62
var header = _modal.find('div.modal-header');
63
var button = header.find('button').detach();
67
.append( '<h4 class="modal-title">'+options.header( row )+'</h4>' )
71
_modal.find( 'div.modal-body' )
84
return DataTable.Responsive;