mirror of
https://github.com/jquery/jquery.git
synced 2026-01-24 09:08:04 -05:00
Move window/document test to dimensions for consistency
This commit is contained in:
@@ -170,11 +170,6 @@ jQuery.each(["height", "width"], function( i, name ) {
|
||||
get: function( elem, computed, extra ) {
|
||||
var val;
|
||||
|
||||
// Tests for window/document
|
||||
if ( !elem.style ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ( computed ) {
|
||||
if ( elem.offsetWidth !== 0 ) {
|
||||
val = getWH( elem, name, extra );
|
||||
|
||||
@@ -7,17 +7,17 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
|
||||
|
||||
// innerHeight and innerWidth
|
||||
jQuery.fn["inner" + name] = function() {
|
||||
var ret;
|
||||
return this[0] && !isNaN( ret = parseFloat(jQuery.css( this[0], type, "padding" )) ) ?
|
||||
ret :
|
||||
var elem = this[0];
|
||||
return elem && elem.style ?
|
||||
parseFloat( jQuery.css( elem, type, "padding" ) ) :
|
||||
null;
|
||||
};
|
||||
|
||||
// outerHeight and outerWidth
|
||||
jQuery.fn["outer" + name] = function( margin ) {
|
||||
var ret;
|
||||
return this[0] && !isNaN( ret = parseFloat(jQuery.css( this[0], type, margin ? "margin" : "border" )) ) ?
|
||||
ret :
|
||||
var elem = this[0];
|
||||
return elem && elem.style ?
|
||||
parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
|
||||
null;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user