From: Scott González Date: Fri, 27 Feb 2015 01:54:24 +0000 (-0500) Subject: Core: Drop feature detection for version check to support jQuery 1.7 X-Git-Tag: 1.12.0-beta.1~432 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c077e0a347826c7acca4ca2f775ca59e3b5f8d07;p=jquery-ui.git Core: Drop feature detection for version check to support jQuery 1.7 Fixes #11197 Closes gh-1458 --- 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 ( !$( "" ).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 ( !$( "" ).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 )