Skip to content

Commit

Permalink
Fix: jQuery 3.3 deprecates some $.is... methods. Use of those metho…
Browse files Browse the repository at this point in the history
…ds has now been removed from DataTables
  • Loading branch information
Allan Jardine committed May 11, 2018
1 parent 0f4ed62 commit e3d03c1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/resources/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ if ( window.$ ) {
}

if ( settings.oFeatures.bServerSide ) {
if ( $.isFunction( settings.ajax ) ) {
if ( typeof settings.ajax === 'function' ) {
return;
}
$.ajax( {
Expand Down
2 changes: 1 addition & 1 deletion examples/server_side/pipeline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,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
Expand Down
6 changes: 3 additions & 3 deletions js/core/core.ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ function _fnBuildAjax( oSettings, data, fn )
{
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 );

Expand Down Expand Up @@ -118,7 +118,7 @@ function _fnBuildAjax( oSettings, data, fn )
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 );
Expand Down
2 changes: 1 addition & 1 deletion js/ext/ext.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ DataTable.ext = _ext = {
* $.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;
* }
*
Expand Down

0 comments on commit e3d03c1

Please sign in to comment.