aboutsummaryrefslogtreecommitdiffstats
path: root/ui/core.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2015-02-26 20:54:24 -0500
committerScott González <scott.gonzalez@gmail.com>2015-02-27 09:08:56 -0500
commitc077e0a347826c7acca4ca2f775ca59e3b5f8d07 (patch)
tree7f8d68416aed85fdd059e9b2ea07e3059874cb67 /ui/core.js
parent45744efd268137216d71c38774821fd7a01d3c34 (diff)
downloadjquery-ui-c077e0a347826c7acca4ca2f775ca59e3b5f8d07.tar.gz
jquery-ui-c077e0a347826c7acca4ca2f775ca59e3b5f8d07.zip
Core: Drop feature detection for version check to support jQuery 1.7
Fixes #11197 Closes gh-1458
Diffstat (limited to 'ui/core.js')
-rw-r--r--ui/core.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/ui/core.js b/ui/core.js
index afaab689b..a7d10fe40 100644
--- a/ui/core.js
+++ b/ui/core.js
@@ -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 )