Skip to content

Commit d0f9ef1

Browse files
committed
All: Switch from $.isArray to Array.isArray
jQuery.isArray will be removed in jQuery 4.0.
1 parent 3b2183e commit d0f9ef1

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

ui/widget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ $.widget = function( name, base, prototype ) {
6060
base = $.Widget;
6161
}
6262

63-
if ( $.isArray( prototype ) ) {
63+
if ( Array.isArray( prototype ) ) {
6464
prototype = $.extend.apply( null, [ {} ].concat( prototype ) );
6565
}
6666

ui/widgets/autocomplete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ $.widget( "ui.autocomplete", {
375375
_initSource: function() {
376376
var array, url,
377377
that = this;
378-
if ( $.isArray( this.options.source ) ) {
378+
if ( Array.isArray( this.options.source ) ) {
379379
array = this.options.source;
380380
this.source = function( request, response ) {
381381
response( $.ui.autocomplete.filter( array, request.term ) );

ui/widgets/dialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ $.widget( "ui.dialog", {
481481
this.uiDialogButtonPane.remove();
482482
this.uiButtonSet.empty();
483483

484-
if ( $.isEmptyObject( buttons ) || ( $.isArray( buttons ) && !buttons.length ) ) {
484+
if ( $.isEmptyObject( buttons ) || ( Array.isArray( buttons ) && !buttons.length ) ) {
485485
this._removeClass( this.uiDialog, "ui-dialog-buttons" );
486486
return;
487487
}

ui/widgets/draggable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ $.widget( "ui.draggable", $.ui.mouse, {
407407
if ( typeof obj === "string" ) {
408408
obj = obj.split( " " );
409409
}
410-
if ( $.isArray( obj ) ) {
410+
if ( Array.isArray( obj ) ) {
411411
obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
412412
}
413413
if ( "left" in obj ) {

ui/widgets/slider.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ return $.widget( "ui.slider", $.ui.mouse, {
132132
options.values = [ this._valueMin(), this._valueMin() ];
133133
} else if ( options.values.length && options.values.length !== 2 ) {
134134
options.values = [ options.values[ 0 ], options.values[ 0 ] ];
135-
} else if ( $.isArray( options.values ) ) {
135+
} else if ( Array.isArray( options.values ) ) {
136136
options.values = options.values.slice( 0 );
137137
}
138138
}
@@ -395,7 +395,7 @@ return $.widget( "ui.slider", $.ui.mouse, {
395395
}
396396

397397
if ( arguments.length ) {
398-
if ( $.isArray( arguments[ 0 ] ) ) {
398+
if ( Array.isArray( arguments[ 0 ] ) ) {
399399
vals = this.options.values;
400400
newValues = arguments[ 0 ];
401401
for ( i = 0; i < vals.length; i += 1 ) {
@@ -429,7 +429,7 @@ return $.widget( "ui.slider", $.ui.mouse, {
429429
}
430430
}
431431

432-
if ( $.isArray( this.options.values ) ) {
432+
if ( Array.isArray( this.options.values ) ) {
433433
valsLength = this.options.values.length;
434434
}
435435

ui/widgets/sortable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ return $.widget( "ui.sortable", $.ui.mouse, {
11551155
if ( typeof obj === "string" ) {
11561156
obj = obj.split( " " );
11571157
}
1158-
if ( $.isArray( obj ) ) {
1158+
if ( Array.isArray( obj ) ) {
11591159
obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
11601160
}
11611161
if ( "left" in obj ) {

ui/widgets/tabs.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ $.widget( "ui.tabs", {
9595

9696
// Take disabling tabs via class attribute from HTML
9797
// into account and update option properly.
98-
if ( $.isArray( options.disabled ) ) {
98+
if ( Array.isArray( options.disabled ) ) {
9999
options.disabled = $.uniqueSort( options.disabled.concat(
100100
$.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
101101
return that.tabs.index( li );
@@ -502,7 +502,7 @@ $.widget( "ui.tabs", {
502502
_setOptionDisabled: function( disabled ) {
503503
var currentItem, li, i;
504504

505-
if ( $.isArray( disabled ) ) {
505+
if ( Array.isArray( disabled ) ) {
506506
if ( !disabled.length ) {
507507
disabled = false;
508508
} else if ( disabled.length === this.anchors.length ) {
@@ -790,7 +790,7 @@ $.widget( "ui.tabs", {
790790
disabled = false;
791791
} else {
792792
index = this._getIndex( index );
793-
if ( $.isArray( disabled ) ) {
793+
if ( Array.isArray( disabled ) ) {
794794
disabled = $.map( disabled, function( num ) {
795795
return num !== index ? num : null;
796796
} );
@@ -816,7 +816,7 @@ $.widget( "ui.tabs", {
816816
if ( $.inArray( index, disabled ) !== -1 ) {
817817
return;
818818
}
819-
if ( $.isArray( disabled ) ) {
819+
if ( Array.isArray( disabled ) ) {
820820
disabled = $.merge( [ index ], disabled ).sort();
821821
} else {
822822
disabled = [ index ];

0 commit comments

Comments
 (0)