diff options
Diffstat (limited to 'libs/bower_components/jquery/src/effects')
-rw-r--r-- | libs/bower_components/jquery/src/effects/Tween.js | 37 | ||||
-rw-r--r-- | libs/bower_components/jquery/src/effects/animatedSelector.js | 8 | ||||
-rw-r--r-- | libs/bower_components/jquery/src/effects/support.js | 19 |
3 files changed, 37 insertions, 27 deletions
diff --git a/libs/bower_components/jquery/src/effects/Tween.js b/libs/bower_components/jquery/src/effects/Tween.js index 12eec55cfc..d26ddd9189 100644 --- a/libs/bower_components/jquery/src/effects/Tween.js +++ b/libs/bower_components/jquery/src/effects/Tween.js @@ -1,4 +1,4 @@ -define([ +define( [ "../core", "../css" ], function( jQuery ) { @@ -13,7 +13,7 @@ Tween.prototype = { init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; - this.easing = easing || "swing"; + this.easing = easing || jQuery.easing._default; this.options = options; this.start = this.now = this.cur(); this.end = end; @@ -59,25 +59,32 @@ Tween.propHooks = { get: function( tween ) { var result; - if ( tween.elem[ tween.prop ] != null && - (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { + // Use a property on the element directly when it is not a DOM element, + // or when there is no matching style property that exists. + if ( tween.elem.nodeType !== 1 || + tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { return tween.elem[ tween.prop ]; } - // passing an empty string as a 3rd parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails - // so, simple values such as "10px" are parsed to Float. - // complex values such as "rotate(1rad)" are returned as is. + // Passing an empty string as a 3rd parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails. + // Simple values such as "10px" are parsed to Float; + // complex values such as "rotate(1rad)" are returned as-is. result = jQuery.css( tween.elem, tween.prop, "" ); + // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { - // use step hook for back compat - use cssHook if its there - use .style if its - // available and use plain properties where available + + // Use step hook for back compat. + // Use cssHook if its there. + // Use .style if available and use plain properties where available. if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { + } else if ( tween.elem.nodeType === 1 && + ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || + jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; @@ -86,9 +93,8 @@ Tween.propHooks = { } }; -// Support: IE <=9 +// Support: IE9 // Panic based approach to setting things on disconnected nodes - Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { @@ -103,7 +109,8 @@ jQuery.easing = { }, swing: function( p ) { return 0.5 - Math.cos( p * Math.PI ) / 2; - } + }, + _default: "swing" }; jQuery.fx = Tween.prototype.init; @@ -111,4 +118,4 @@ jQuery.fx = Tween.prototype.init; // Back Compat <1.8 extension point jQuery.fx.step = {}; -}); +} ); diff --git a/libs/bower_components/jquery/src/effects/animatedSelector.js b/libs/bower_components/jquery/src/effects/animatedSelector.js index bc5a3d6c11..d84c9c7032 100644 --- a/libs/bower_components/jquery/src/effects/animatedSelector.js +++ b/libs/bower_components/jquery/src/effects/animatedSelector.js @@ -1,13 +1,13 @@ -define([ +define( [ "../core", "../selector", "../effects" ], function( jQuery ) { jQuery.expr.filters.animated = function( elem ) { - return jQuery.grep(jQuery.timers, function( fn ) { + return jQuery.grep( jQuery.timers, function( fn ) { return elem === fn.elem; - }).length; + } ).length; }; -}); +} ); diff --git a/libs/bower_components/jquery/src/effects/support.js b/libs/bower_components/jquery/src/effects/support.js index 3ef7261d50..22d4ecb2e9 100644 --- a/libs/bower_components/jquery/src/effects/support.js +++ b/libs/bower_components/jquery/src/effects/support.js @@ -1,9 +1,9 @@ -define([ - "../var/strundefined", - "../var/support" -], function( strundefined, support ) { +define( [ + "../var/support", + "../var/document" +], function( support, document ) { -(function() { +( function() { var shrinkWrapBlocksVal; support.shrinkWrapBlocks = function() { @@ -19,6 +19,7 @@ define([ body = document.getElementsByTagName( "body" )[ 0 ]; if ( !body || !body.style ) { + // Test fired too early or in an unsupported environment, exit. return; } @@ -31,9 +32,11 @@ define([ // Support: IE6 // Check if elements with layout shrink-wrap their children - if ( typeof div.style.zoom !== strundefined ) { + if ( typeof div.style.zoom !== "undefined" ) { + // Reset CSS: box-sizing; display; margin; border div.style.cssText = + // Support: Firefox<29, Android 2.3 // Vendor-prefix box-sizing "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + @@ -48,8 +51,8 @@ define([ return shrinkWrapBlocksVal; }; -})(); +} )(); return support; -}); +} ); |