Permalink
Browse files

Core: Drop feature detection for version check to support jQuery 1.7

Fixes #11197
Closes gh-1458
  • Loading branch information...
scottgonzalez committed Feb 27, 2015
1 parent 45744ef commit c077e0a347826c7acca4ca2f775ca59e3b5f8d07
Showing with 11 additions and 5 deletions.
  1. +11 −5 ui/core.js
View
@@ -142,8 +142,17 @@ $.extend( $.expr[ ":" ], {
}
});
// support: jQuery <1.8
if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
// support: jQuery 1.7 only
// Not a great way to check versions, but since we only support 1.7+ and only
// need to detect <1.8, this is a simple check that should suffice. Checking
// for "1.7." would be a bit safer, but the version string is 1.7, not 1.7.0
// and we'll never reach 1.70.0 (if we do, we certainly won't be supporting
// 1.7 anymore). See #11197 for why we're not using feature detection.
if ( $.fn.jquery.substring( 0, 3 ) === "1.7" ) {
// Setters for .innerWidth(), .innerHeight(), .outerWidth(), .outerHeight()
// Unlike jQuery Core 1.8+, these only support numeric values to set the
// dimensions in pixels
$.each( [ "Width", "Height" ], function( i, name ) {
var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
type = name.toLowerCase(),
@@ -187,10 +196,7 @@ if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
});
};
});
}
// support: jQuery <1.8
if ( !$.fn.addBack ) {
$.fn.addBack = function( selector ) {
return this.add( selector == null ?
this.prevObject : this.prevObject.filter( selector )

0 comments on commit c077e0a

Please sign in to comment.