From 1efb34501e93a3da36752430e7a433df1c9d5534 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Thu, 14 Jun 2018 11:38:08 +0100 Subject: [PATCH] Fix: jQuery 3.3 deprecates some `$.is...` methods. Use of those methods has now been removed from DataTables --- .datatables-commit-sync | 2 +- examples/resources/demo.js | 2 +- examples/server_side/pipeline.html | 4 ++-- media/js/jquery.dataTables.js | 8 ++++---- media/js/jquery.dataTables.min.js | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.datatables-commit-sync b/.datatables-commit-sync index b214dd26..c866d89f 100644 --- a/.datatables-commit-sync +++ b/.datatables-commit-sync @@ -1 +1 @@ -988f42b34f591732d5541e4b8534f61cd6b7d048 +e3d03c13372a61e3914228312e466d1f14787207 diff --git a/examples/resources/demo.js b/examples/resources/demo.js index 5217a4ad..1c88da08 100644 --- a/examples/resources/demo.js +++ b/examples/resources/demo.js @@ -94,7 +94,7 @@ if ( window.$ ) { } if ( settings.oFeatures.bServerSide ) { - if ( $.isFunction( settings.ajax ) ) { + if ( typeof settings.ajax === 'function' ) { return; } $.ajax( { diff --git a/examples/server_side/pipeline.html b/examples/server_side/pipeline.html index 57542ac2..9fdf84cd 100644 --- a/examples/server_side/pipeline.html +++ b/examples/server_side/pipeline.html @@ -81,7 +81,7 @@ $.fn.dataTable.pipeline = function ( opts ) { request.length = requestLength*conf.pages; // Provide the same `data` options as DataTables. - if ( $.isFunction ( conf.data ) ) { + if ( typeof conf.data === 'function' ) { // As a function it is executed with the data object as an arg // for manipulation. If an object is returned, it is used as the // data object to submit @@ -262,7 +262,7 @@ $.fn.dataTable.pipeline = function ( opts ) { request.length = requestLength*conf.pages; // Provide the same `data` options as DataTables. - if ( $.isFunction ( conf.data ) ) { + if ( typeof conf.data === 'function' ) { // As a function it is executed with the data object as an arg // for manipulation. If an object is returned, it is used as the // data object to submit diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 5f42a9eb..9870bafb 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -3868,12 +3868,12 @@ { ajaxData = ajax.data; - var newData = $.isFunction( ajaxData ) ? + var newData = typeof ajaxData === 'function' ? ajaxData( data, oSettings ) : // fn can manipulate data or return ajaxData; // an object object or array to merge // If the function returned something, use that alone - data = $.isFunction( ajaxData ) && newData ? + data = typeof ajaxData === 'function' && newData ? newData : $.extend( true, data, newData ); @@ -3937,7 +3937,7 @@ url: ajax || oSettings.sAjaxSource } ) ); } - else if ( $.isFunction( ajax ) ) + else if ( typeof ajax === 'function' ) { // Is a function - let the caller define what needs to be done oSettings.jqXHR = ajax.call( instance, data, callback, oSettings ); @@ -14196,7 +14196,7 @@ * $.fn.dataTable.ext.type.detect.push( * function ( data, settings ) { * // Check the numeric part - * if ( ! $.isNumeric( data.substring(1) ) ) { + * if ( ! data.substring(1).match(/[0-9]/) ) { * return null; * } * diff --git a/media/js/jquery.dataTables.min.js b/media/js/jquery.dataTables.min.js index 6fa49a1d..d4a84c25 100644 --- a/media/js/jquery.dataTables.min.js +++ b/media/js/jquery.dataTables.min.js @@ -32,9 +32,9 @@ d.append(h(b));r(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bD a.nTable.nextSibling;for(var f=a.sDom.split(""),g,j,i,m,l,q,k=0;k")[0];m=f[k+1];if("'"==m||'"'==m){l="";for(q=2;f[k+q]!=m;)l+=f[k+q],q++;"H"==l?l=b.sJUIHeader:"F"==l&&(l=b.sJUIFooter);-1!=l.indexOf(".")?(m=l.split("."),i.id=m[0].substr(1,m[0].length-1),i.className=m[1]):"#"==l.charAt(0)?i.id=l.substr(1,l.length-1):i.className=l;k+=q}e.append(i);e=h(i)}else if(">"==j)e=e.parent();else if("l"==j&&d.bPaginate&&d.bLengthChange)g=ob(a);else if("f"==j&& d.bFilter)g=pb(a);else if("r"==j&&d.bProcessing)g=qb(a);else if("t"==j)g=rb(a);else if("i"==j&&d.bInfo)g=sb(a);else if("p"==j&&d.bPaginate)g=tb(a);else if(0!==n.ext.feature.length){i=n.ext.feature;q=0;for(m=i.length;q',j=d.sSearch,j=j.match(/_INPUT_/)?j.replace("_INPUT_",