| 1 | define( [
|
| 2 | "../core",
|
| 3 | "../core/isAttached",
|
| 4 | "./var/rboxStyle",
|
| 5 | "./var/rnumnonpx",
|
| 6 | "./var/getStyles",
|
| 7 | "./support"
|
| 8 | ], function( jQuery, isAttached, rboxStyle, rnumnonpx, getStyles, support ) {
|
| 9 |
|
| 10 | "use strict";
|
| 11 |
|
| 12 | function curCSS( elem, name, computed ) {
|
| 13 | var width, minWidth, maxWidth, ret,
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 | style = elem.style;
|
| 20 |
|
| 21 | computed = computed || getStyles( elem );
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 | if ( computed ) {
|
| 27 | ret = computed.getPropertyValue( name ) || computed[ name ];
|
| 28 |
|
| 29 | if ( ret === "" && !isAttached( elem ) ) {
|
| 30 | ret = jQuery.style( elem, name );
|
| 31 | }
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 | if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
|
| 39 |
|
| 40 |
|
| 41 | width = style.width;
|
| 42 | minWidth = style.minWidth;
|
| 43 | maxWidth = style.maxWidth;
|
| 44 |
|
| 45 |
|
| 46 | style.minWidth = style.maxWidth = style.width = ret;
|
| 47 | ret = computed.width;
|
| 48 |
|
| 49 |
|
| 50 | style.width = width;
|
| 51 | style.minWidth = minWidth;
|
| 52 | style.maxWidth = maxWidth;
|
| 53 | }
|
| 54 | }
|
| 55 |
|
| 56 | return ret !== undefined ?
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 | ret + "" :
|
| 61 | ret;
|
| 62 | }
|
| 63 |
|
| 64 | return curCSS;
|
| 65 | } );
|