From 86a958d3aa04a5928484d16b27a4d3eea39142e4 Mon Sep 17 00:00:00 2001 From: Scott González Date: Tue, 23 Oct 2012 15:12:54 -0400 Subject: Core: Update :focsable and :tabbable to handle parents with no height/width, but visible overflow. Fixes #8643 - :focusable pseudo-selector does not find elements if parent has 0x0 dimension. --- ui/jquery.ui.core.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ui/jquery.ui.core.js') diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index e569eea42..2e9d53ae3 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -198,10 +198,10 @@ function focusable( element, isTabIndexNotNaN ) { } function visible( element ) { - return !$( element ).parents().andSelf().filter(function() { - return $.css( this, "visibility" ) === "hidden" || - $.expr.filters.hidden( this ); - }).length; + return $.expr.filters.visible( element ) && + !$( element ).parents().andSelf().filter(function() { + return $.css( this, "visibility" ) === "hidden"; + }).length; } $.extend( $.expr[ ":" ], { -- cgit v1.2.3 From 0c672543bf897c0d8c162a2daedbf3a85206f227 Mon Sep 17 00:00:00 2001 From: Scott González Date: Fri, 26 Oct 2012 15:45:34 -0400 Subject: Core: Removed $.support.minHeight. --- ui/jquery.ui.core.js | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'ui/jquery.ui.core.js') diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index 2e9d53ae3..7b5590fc1 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -228,29 +228,7 @@ $.extend( $.expr[ ":" ], { }); // support -$(function() { - var body = document.body, - div = body.appendChild( div = document.createElement( "div" ) ); - - // access offsetHeight before setting the style to prevent a layout bug - // in IE 9 which causes the element to continue to take up space even - // after it is removed from the DOM (#8026) - div.offsetHeight; - - $.extend( div.style, { - minHeight: "100px", - height: "auto", - padding: 0, - borderWidth: 0 - }); - - $.support.minHeight = div.offsetHeight === 100; - $.support.selectstart = "onselectstart" in div; - - // set display to none to avoid a layout bug in IE - // http://dev.jquery.com/ticket/4014 - body.removeChild( div ).style.display = "none"; -}); +$.support.selectstart = "onselectstart" in document.createElement( "div" ); -- cgit v1.2.3 From 995eb1261e5e6bb57cad292a56911893d539472e Mon Sep 17 00:00:00 2001 From: Scott González Date: Fri, 26 Oct 2012 16:08:05 -0400 Subject: Core: Removed $.ui.ie6. --- ui/jquery.ui.core.js | 1 - 1 file changed, 1 deletion(-) (limited to 'ui/jquery.ui.core.js') diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index 7b5590fc1..fadd42cad 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -239,7 +239,6 @@ $.support.selectstart = "onselectstart" in document.createElement( "div" ); (function() { var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || []; $.ui.ie = uaMatch.length ? true : false; - $.ui.ie6 = parseFloat( uaMatch[ 1 ], 10 ) === 6; })(); $.fn.extend({ -- cgit v1.2.3 From c67727582148d1d4ed657b654eff5da914c7ac97 Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 5 Nov 2012 11:28:04 -0500 Subject: Core: Simplify IE check now that we don't care about IE6. --- ui/jquery.ui.core.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'ui/jquery.ui.core.js') diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index fadd42cad..26a956b1a 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -235,11 +235,7 @@ $.support.selectstart = "onselectstart" in document.createElement( "div" ); // deprecated - -(function() { - var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || []; - $.ui.ie = uaMatch.length ? true : false; -})(); +$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); $.fn.extend({ disableSelection: function() { -- cgit v1.2.3 From 8a32c39136996db17c0ca2ece636d3814466934d Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 5 Nov 2012 15:24:45 -0500 Subject: Core: Moved old jQuery support code to the bottom (above deprecated). --- ui/jquery.ui.core.js | 94 ++++++++++++++++++++++++++-------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) (limited to 'ui/jquery.ui.core.js') diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index 26a956b1a..5d8a9935c 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -128,53 +128,6 @@ $.fn.extend({ } }); -// support: jQuery <1.8 -if ( !$( "" ).outerWidth( 1 ).jquery ) { - $.each( [ "Width", "Height" ], function( i, name ) { - var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], - type = name.toLowerCase(), - orig = { - innerWidth: $.fn.innerWidth, - innerHeight: $.fn.innerHeight, - outerWidth: $.fn.outerWidth, - outerHeight: $.fn.outerHeight - }; - - function reduce( elem, size, border, margin ) { - $.each( side, function() { - size -= parseFloat( $.css( elem, "padding" + this ) ) || 0; - if ( border ) { - size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0; - } - if ( margin ) { - size -= parseFloat( $.css( elem, "margin" + this ) ) || 0; - } - }); - return size; - } - - $.fn[ "inner" + name ] = function( size ) { - if ( size === undefined ) { - return orig[ "inner" + name ].call( this ); - } - - return this.each(function() { - $( this ).css( type, reduce( this, size ) + "px" ); - }); - }; - - $.fn[ "outer" + name] = function( size, margin ) { - if ( typeof size !== "number" ) { - return orig[ "outer" + name ].call( this, size ); - } - - return this.each(function() { - $( this).css( type, reduce( this, size, true, margin ) + "px" ); - }); - }; - }); -} - // selectors function focusable( element, isTabIndexNotNaN ) { var map, mapName, img, @@ -230,6 +183,53 @@ $.extend( $.expr[ ":" ], { // support $.support.selectstart = "onselectstart" in document.createElement( "div" ); +// support: jQuery <1.8 +if ( !$( "" ).outerWidth( 1 ).jquery ) { + $.each( [ "Width", "Height" ], function( i, name ) { + var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], + type = name.toLowerCase(), + orig = { + innerWidth: $.fn.innerWidth, + innerHeight: $.fn.innerHeight, + outerWidth: $.fn.outerWidth, + outerHeight: $.fn.outerHeight + }; + + function reduce( elem, size, border, margin ) { + $.each( side, function() { + size -= parseFloat( $.css( elem, "padding" + this ) ) || 0; + if ( border ) { + size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0; + } + if ( margin ) { + size -= parseFloat( $.css( elem, "margin" + this ) ) || 0; + } + }); + return size; + } + + $.fn[ "inner" + name ] = function( size ) { + if ( size === undefined ) { + return orig[ "inner" + name ].call( this ); + } + + return this.each(function() { + $( this ).css( type, reduce( this, size ) + "px" ); + }); + }; + + $.fn[ "outer" + name] = function( size, margin ) { + if ( typeof size !== "number" ) { + return orig[ "outer" + name ].call( this, size ); + } + + return this.each(function() { + $( this).css( type, reduce( this, size, true, margin ) + "px" ); + }); + }; + }); +} + -- cgit v1.2.3 From 886d6fe9fb8bcbf5e4e968bdd535a0fbcf2b88f7 Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 5 Nov 2012 15:38:31 -0500 Subject: Core: Patch over broken .removeData() in jQuery 1.6.1 + 1.6.2. --- ui/jquery.ui.core.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'ui/jquery.ui.core.js') diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index 5d8a9935c..288634376 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -230,6 +230,19 @@ if ( !$( "" ).outerWidth( 1 ).jquery ) { }); } +// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413) +if ( $( "" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) { + $.fn.removeData = (function( removeData ) { + return function( key ) { + if ( arguments.length ) { + return removeData.call( this, $.camelCase( key ) ); + } else { + return removeData.call( this ); + } + }; + })( $.fn.removeData ); +} + -- cgit v1.2.3