diff options
Diffstat (limited to 'libs/bower_components/jquery/src/dimensions.js')
-rw-r--r-- | libs/bower_components/jquery/src/dimensions.js | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/libs/bower_components/jquery/src/dimensions.js b/libs/bower_components/jquery/src/dimensions.js index 5898832f90..0095cb9c67 100644 --- a/libs/bower_components/jquery/src/dimensions.js +++ b/libs/bower_components/jquery/src/dimensions.js @@ -1,4 +1,4 @@ -define([ +define( [ "./core", "./core/access", "./css" @@ -6,7 +6,9 @@ define([ // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { - jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { + jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, + function( defaultExtra, funcName ) { + // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), @@ -16,6 +18,7 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { var doc; if ( jQuery.isWindow( elem ) ) { + // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 @@ -26,8 +29,10 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { if ( elem.nodeType === 9 ) { doc = elem.documentElement; - // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest - // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. + // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], + // whichever is greatest + // unfortunately, this causes bug #3838 in IE6/8 only, + // but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], @@ -36,6 +41,7 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { } return value === undefined ? + // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : @@ -43,8 +49,8 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; - }); -}); + } ); +} ); return jQuery; -}); +} ); |