|
define( [ |
|
"../core", |
|
"./var/rnumnonpx", |
|
"./var/rmargin", |
|
"./var/getStyles", |
|
"./support", |
|
"../selector" |
|
], function( jQuery, rnumnonpx, rmargin, getStyles, support ) { |
|
|
|
function curCSS( elem, name, computed ) { |
|
var width, minWidth, maxWidth, ret, |
|
style = elem.style; |
|
|
|
computed = computed || getStyles( elem ); |
|
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; |
|
|
|
|
|
|
|
|
|
if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) { |
|
ret = jQuery.style( elem, name ); |
|
} |
|
|
|
|
|
|
|
if ( computed ) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { |
|
|
|
|
|
width = style.width; |
|
minWidth = style.minWidth; |
|
maxWidth = style.maxWidth; |
|
|
|
|
|
style.minWidth = style.maxWidth = style.width = ret; |
|
ret = computed.width; |
|
|
|
|
|
style.width = width; |
|
style.minWidth = minWidth; |
|
style.maxWidth = maxWidth; |
|
} |
|
} |
|
|
|
return ret !== undefined ? |
|
|
|
|
|
|
|
ret + "" : |
|
ret; |
|
} |
|
|
|
return curCSS; |
|
} ); |
|
|