Skip to content

Commit c077e0a

Browse files
committed
Core: Drop feature detection for version check to support jQuery 1.7
Fixes #11197 Closes gh-1458
1 parent 45744ef commit c077e0a

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

ui/core.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,17 @@ $.extend( $.expr[ ":" ], {
142142
}
143143
});
144144

145-
// support: jQuery <1.8
146-
if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
145+
// support: jQuery 1.7 only
146+
// Not a great way to check versions, but since we only support 1.7+ and only
147+
// need to detect <1.8, this is a simple check that should suffice. Checking
148+
// for "1.7." would be a bit safer, but the version string is 1.7, not 1.7.0
149+
// and we'll never reach 1.70.0 (if we do, we certainly won't be supporting
150+
// 1.7 anymore). See #11197 for why we're not using feature detection.
151+
if ( $.fn.jquery.substring( 0, 3 ) === "1.7" ) {
152+
153+
// Setters for .innerWidth(), .innerHeight(), .outerWidth(), .outerHeight()
154+
// Unlike jQuery Core 1.8+, these only support numeric values to set the
155+
// dimensions in pixels
147156
$.each( [ "Width", "Height" ], function( i, name ) {
148157
var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
149158
type = name.toLowerCase(),
@@ -187,10 +196,7 @@ if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
187196
});
188197
};
189198
});
190-
}
191199

192-
// support: jQuery <1.8
193-
if ( !$.fn.addBack ) {
194200
$.fn.addBack = function( selector ) {
195201
return this.add( selector == null ?
196202
this.prevObject : this.prevObject.filter( selector )

0 commit comments

Comments
 (0)