This commit polyfills `jQuery.expr.pseudos` for old versions of jQuery.
Fixes #15185
Closes gh-1773
factory( jQuery );
}
} ( function( $ ) {
-return $.extend( $.expr[ ":" ], {
+return $.extend( $.expr.pseudos, {
data: $.expr.createPseudo ?
$.expr.createPseudo( function( dataName ) {
return function( elem ) {
return visibility !== "hidden";
}
-$.extend( $.expr[ ":" ], {
+$.extend( $.expr.pseudos, {
focusable: function( element ) {
return $.ui.focusable( element, $.attr( element, "tabindex" ) != null );
}
/*!
- * jQuery UI Support for jQuery core 1.7.x @VERSION
+ * jQuery UI Support for jQuery core 1.7.x and newer @VERSION
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
};
}
+// 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;
+}
+
} ) );
}
} ( function( $ ) {
-return $.extend( $.expr[ ":" ], {
+return $.extend( $.expr.pseudos, {
tabbable: function( element ) {
var tabIndex = $.attr( element, "tabindex" ),
hasTabindex = tabIndex != null;
}
// Create selector for plugin
- $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
+ $.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) {
return !!$.data( elem, fullName );
};
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() );
}
} );
} );
- this.childWidgets = $( $.unique( childWidgets ) );
+ this.childWidgets = $( $.uniqueSort( childWidgets ) );
this._addClass( this.childWidgets, "ui-controlgroup-item" );
},
// 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 );
} )