From bb4d888f4f7886371347b59eae5d4e6135acb7ed Mon Sep 17 00:00:00 2001 From: Michał Gołębiowski Date: Mon, 30 Mar 2015 19:19:15 +0200 Subject: 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 --- src/css/swap.js | 28 ---------------------------- src/css/var/swap.js | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 28 deletions(-) delete mode 100644 src/css/swap.js create mode 100644 src/css/var/swap.js (limited to 'src/css') diff --git a/src/css/swap.js b/src/css/swap.js deleted file mode 100644 index ce1643531..000000000 --- a/src/css/swap.js +++ /dev/null @@ -1,28 +0,0 @@ -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; - -}); diff --git a/src/css/var/swap.js b/src/css/var/swap.js new file mode 100644 index 000000000..61351f14b --- /dev/null +++ b/src/css/var/swap.js @@ -0,0 +1,24 @@ +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; +}; + +}); -- cgit v1.2.3