Skip to content

[1.13] Feature/remove some jquery 3 migrate warnings #1773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
factory( jQuery );
}
} ( function( $ ) {
return $.extend( $.expr[ ":" ], {
return $.extend( jQuery.expr.pseudos, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to stay as $ instead of jQuery for noConflict() support. $ is a local reference via the parameter.

I'll make the change when I land this.

data: $.expr.createPseudo ?
$.expr.createPseudo( function( dataName ) {
return function( elem ) {
Expand Down
2 changes: 1 addition & 1 deletion ui/focusable.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function visible( element ) {
return visibility !== "hidden";
}

$.extend( $.expr[ ":" ], {
$.extend( $.expr.pseudos, {
focusable: function( element ) {
return $.ui.focusable( element, $.attr( element, "tabindex" ) != null );
}
Expand Down
12 changes: 12 additions & 0 deletions ui/jquery-1-7.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,16 @@ if ( $.fn.jquery.substring( 0, 3 ) === "1.7" ) {
};
}

// Support: jQuery 1.9.x or older
// $.expr[ ":" ] is deprecated.
if ( !$.expr.pseudos ) {
$.expr.pseudos = $.expr[ ":" ];
}

// Support: jQuery 1.11.x or older
// $.unique has been renamed to $.uniqueSort
if ( !$.uniqueSort ) {
$.uniqueSort = $.unique;
}

} ) );
2 changes: 1 addition & 1 deletion ui/tabbable.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
} ( function( $ ) {

return $.extend( $.expr[ ":" ], {
return $.extend( $.expr.pseudos, {
tabbable: function( element ) {
var tabIndex = $.attr( element, "tabindex" ),
hasTabindex = tabIndex != null;
Expand Down
4 changes: 2 additions & 2 deletions ui/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ $.widget = function( name, base, prototype ) {
}

// Create selector for plugin
$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
$.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) {
return !!$.data( elem, fullName );
};

Expand Down Expand Up @@ -517,7 +517,7 @@ $.Widget.prototype = {
current = that.classesElementLookup[ classes[ i ] ] || $();
if ( options.add ) {
bindRemoveEvent();
current = $( $.unique( current.get().concat( options.element.get() ) ) );
current = $( $.uniqueSort( current.get().concat( options.element.get() ) ) );
} else {
current = $( current.not( options.element ).get() );
}
Expand Down
2 changes: 1 addition & 1 deletion ui/widgets/controlgroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ return $.widget( "ui.controlgroup", {
} );
} );

this.childWidgets = $( $.unique( childWidgets ) );
this.childWidgets = $( $.uniqueSort( childWidgets ) );
this._addClass( this.childWidgets, "ui-controlgroup-item" );
},

Expand Down
2 changes: 1 addition & 1 deletion ui/widgets/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ $.widget( "ui.tabs", {
// Take disabling tabs via class attribute from HTML
// into account and update option properly.
if ( $.isArray( options.disabled ) ) {
options.disabled = $.unique( options.disabled.concat(
options.disabled = $.uniqueSort( options.disabled.concat(
$.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
return that.tabs.index( li );
} )
Expand Down