"./css/var/cssExpand",
"./css/var/isHidden",
"./css/var/getStyles",
+ "./css/var/swap",
"./css/curCSS",
"./css/adjustCSS",
"./css/defaultDisplay",
"./data/var/dataPriv",
"./core/init",
- "./css/swap",
"./core/ready",
"./selector" // contains
], function( jQuery, pnum, access, rmargin, rcssNum, rnumnonpx, cssExpand, isHidden,
- getStyles, curCSS, adjustCSS, defaultDisplay, addGetHookIf, support, dataPriv ) {
+ getStyles, swap, curCSS, adjustCSS, defaultDisplay, addGetHookIf, support, dataPriv ) {
var
// Swappable if display is none or starts with table
// but it must have a current display style that would benefit
return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
elem.offsetWidth === 0 ?
- jQuery.swap( elem, cssShow, function() {
+ swap( elem, cssShow, function() {
return getWidthOrHeight( elem, name, extra );
}) :
getWidthOrHeight( elem, name, extra );
jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
function( elem, computed ) {
if ( computed ) {
- return jQuery.swap( elem, { "display": "inline-block" },
+ return swap( elem, { "display": "inline-block" },
curCSS, [ elem, "marginRight" ] );
}
}
+++ /dev/null
-define([
- "../core"
-], function( jQuery ) {
-
-// A method for quickly swapping in/out CSS properties to get correct calculations.
-jQuery.swap = function( elem, options, callback, args ) {
- var ret, name,
- old = {};
-
- // Remember the old values, and insert the new ones
- for ( name in options ) {
- old[ name ] = elem.style[ name ];
- elem.style[ name ] = options[ name ];
- }
-
- ret = callback.apply( elem, args || [] );
-
- // Revert the old values
- for ( name in options ) {
- elem.style[ name ] = old[ name ];
- }
-
- return ret;
-};
-
-return jQuery.swap;
-
-});
--- /dev/null
+define(function() {
+
+// A method for quickly swapping in/out CSS properties to get correct calculations.
+return function swap( elem, options, callback, args ) {
+ var ret, name,
+ old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ ret = callback.apply( elem, args || [] );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+
+ return ret;
+};
+
+});