aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.core.js
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2012-11-10 01:40:05 +0100
committerFelix Nagel <info@felixnagel.com>2012-11-10 01:40:05 +0100
commit7ce8e0515ea7cc513c3c065946c85cf2d1aa5652 (patch)
treea0337f9f7d8d0d27a7cdb78a63ee152d8357b32f /ui/jquery.ui.core.js
parent94b3a65c66e338fc6f697d13fc77d7f19b8666ae (diff)
parentd6c6b7dc3381432f50212b4f458931b2521ecb56 (diff)
downloadjquery-ui-7ce8e0515ea7cc513c3c065946c85cf2d1aa5652.tar.gz
jquery-ui-7ce8e0515ea7cc513c3c065946c85cf2d1aa5652.zip
Merge branch 'master' into selectmenu
Diffstat (limited to 'ui/jquery.ui.core.js')
-rw-r--r--ui/jquery.ui.core.js142
1 files changed, 64 insertions, 78 deletions
diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js
index e569eea42..288634376 100644
--- a/ui/jquery.ui.core.js
+++ b/ui/jquery.ui.core.js
@@ -128,53 +128,6 @@ $.fn.extend({
}
});
-// support: jQuery <1.8
-if ( !$( "<a>" ).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,
@@ -198,10 +151,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[ ":" ], {
@@ -228,41 +181,74 @@ $.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.selectstart = "onselectstart" in document.createElement( "div" );
- $.support.minHeight = div.offsetHeight === 100;
- $.support.selectstart = "onselectstart" in div;
+// support: jQuery <1.8
+if ( !$( "<a>" ).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
+ };
- // set display to none to avoid a layout bug in IE
- // http://dev.jquery.com/ticket/4014
- body.removeChild( div ).style.display = "none";
-});
+ 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" );
+ });
+ };
+ });
+}
+
+// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
+if ( $( "<a>" ).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 );
+}
-// deprecated
-(function() {
- var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || [];
- $.ui.ie = uaMatch.length ? true : false;
- $.ui.ie6 = parseFloat( uaMatch[ 1 ], 10 ) === 6;
-})();
+// deprecated
+$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
$.fn.extend({
disableSelection: function() {