Commit 02a9d9f9 authored by Michał Gołębiowski's avatar Michał Gołębiowski Committed by Timmy Willison

CSS: Don't expose jQuery.swap

jQuery.swap was an undocumented API used only internally. With the modular
AMD system we currently have it's not necessary to expose this function
publicly under the jQuery object.

Fixes gh-2058
Closes gh-2182
parent 345c95ae
...@@ -7,6 +7,7 @@ define([ ...@@ -7,6 +7,7 @@ define([
"./css/var/rnumnonpx", "./css/var/rnumnonpx",
"./css/var/cssExpand", "./css/var/cssExpand",
"./css/var/isHidden", "./css/var/isHidden",
"./css/var/swap",
"./css/curCSS", "./css/curCSS",
"./css/adjustCSS", "./css/adjustCSS",
"./css/defaultDisplay", "./css/defaultDisplay",
...@@ -14,11 +15,10 @@ define([ ...@@ -14,11 +15,10 @@ define([
"./css/support", "./css/support",
"./core/init", "./core/init",
"./css/swap",
"./core/ready", "./core/ready",
"./selector" // contains "./selector" // contains
], function( jQuery, pnum, access, rmargin, rcssNum, rnumnonpx, cssExpand, isHidden, ], function( jQuery, pnum, access, rmargin, rcssNum, rnumnonpx, cssExpand, isHidden,
curCSS, adjustCSS, defaultDisplay, addGetHookIf, support ) { curCSS, swap, adjustCSS, defaultDisplay, addGetHookIf, support ) {
var var
// BuildExclude // BuildExclude
...@@ -366,7 +366,7 @@ jQuery.each([ "height", "width" ], function( i, name ) { ...@@ -366,7 +366,7 @@ jQuery.each([ "height", "width" ], function( i, name ) {
// however, it must have a current display style that would benefit from this // however, it must have a current display style that would benefit from this
return rdisplayswap.test( jQuery.css( elem, "display" ) ) && return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
elem.offsetWidth === 0 ? elem.offsetWidth === 0 ?
jQuery.swap( elem, cssShow, function() { swap( elem, cssShow, function() {
return getWidthOrHeight( elem, name, extra ); return getWidthOrHeight( elem, name, extra );
}) : }) :
getWidthOrHeight( elem, name, extra ); getWidthOrHeight( elem, name, extra );
...@@ -440,7 +440,7 @@ if ( !support.opacity ) { ...@@ -440,7 +440,7 @@ if ( !support.opacity ) {
jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
function( elem, computed ) { function( elem, computed ) {
if ( computed ) { if ( computed ) {
return jQuery.swap( elem, { "display": "inline-block" }, return swap( elem, { "display": "inline-block" },
curCSS, [ elem, "marginRight" ] ); curCSS, [ elem, "marginRight" ] );
} }
} }
......
define([ define(function() {
"../core"
], function( jQuery ) {
// A method for quickly swapping in/out CSS properties to get correct calculations. // A method for quickly swapping in/out CSS properties to get correct calculations.
jQuery.swap = function( elem, options, callback, args ) { return function swap( elem, options, callback, args ) {
var ret, name, var ret, name,
old = {}; old = {};
...@@ -23,6 +21,4 @@ jQuery.swap = function( elem, options, callback, args ) { ...@@ -23,6 +21,4 @@ jQuery.swap = function( elem, options, callback, args ) {
return ret; return ret;
}; };
return jQuery.swap;
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment