app/assets/javascripts/datatables/extensions/Buttons/buttons.print.js in jquery-datatables-1.10.12 vs app/assets/javascripts/datatables/extensions/Buttons/buttons.print.js in jquery-datatables-1.10.13
- old
+ new
@@ -124,22 +124,28 @@
var head = '<title>'+title+'</title>';
$('style, link').each( function () {
head += _relToAbs( this );
} );
- //$(win.document.head).html( head );
- win.document.head.innerHTML = head; // Work around for Edge
+ try {
+ win.document.head.innerHTML = head; // Work around for Edge
+ }
+ catch (e) {
+ $(win.document.head).html( head ); // Old IE
+ }
// Inject the table and other surrounding information
win.document.body.innerHTML =
'<h1>'+title+'</h1>'+
- '<div>'+config.message+'</div>'+
+ '<div>'+
+ (typeof config.message === 'function' ?
+ config.message( dt, button, config ) :
+ config.message
+ )+
+ '</div>'+
html;
- // $(win.document.body).html(
- // '<h1>'+title+'</h1>'+
- // '<div>'+config.message+'</div>'+
- // html
- // );
+
+ $(win.document.body).addClass('dt-print-view');
if ( config.customize ) {
config.customize( win );
}