aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.effects.shake.js
diff options
context:
space:
mode:
authorgnarf <gnarf@gnarf.net>2011-06-21 01:15:42 -0500
committergnarf <gnarf@gnarf.net>2011-06-21 01:18:11 -0500
commit65a6c46e5568c43a9df9505e23da6a766814557e (patch)
tree63087dadabc63382d06c369062644fc64d252f5f /ui/jquery.effects.shake.js
parent1c1a3b1a361d90a73755fbd038b3cdfb0960c29f (diff)
downloadjquery-ui-65a6c46e5568c43a9df9505e23da6a766814557e.tar.gz
jquery-ui-65a6c46e5568c43a9df9505e23da6a766814557e.zip
Effects.*: Style Guidance
Diffstat (limited to 'ui/jquery.effects.shake.js')
-rw-r--r--ui/jquery.effects.shake.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/ui/jquery.effects.shake.js b/ui/jquery.effects.shake.js
index 82d7ae97e..311edced0 100644
--- a/ui/jquery.effects.shake.js
+++ b/ui/jquery.effects.shake.js
@@ -23,7 +23,7 @@ $.effects.effect.shake = function( o, next ) {
anims = times * 2 + 1,
speed = o.duration,
ref = (direction == "up" || direction == "down") ? "top" : "left",
- motion = (direction == "up" || direction == "left") ? "pos" : "neg",
+ positiveMotion = (direction == "up" || direction == "left"),
animation = {},
animation1 = {},
animation2 = {},
@@ -39,9 +39,9 @@ $.effects.effect.shake = function( o, next ) {
$.effects.createWrapper( el );
// Animation
- animation[ ref ] = ( motion == "pos" ? "-=" : "+=" ) + distance;
- animation1[ ref ] = ( motion == "pos" ? "+=" : "-=" ) + distance * 2;
- animation2[ ref ] = ( motion == "pos" ? "-=" : "+=" ) + distance * 2;
+ animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
+ animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
+ animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
// Animate
el.animate( animation, speed, o.easing );
@@ -59,7 +59,9 @@ $.effects.effect.shake = function( o, next ) {
}
$.effects.restore( el, props );
$.effects.removeWrapper( el );
- $.isFunction( o.complete ) && o.complete.apply( this, arguments );
+ if ( $.isFunction( o.complete ) ) {
+ o.complete.apply( this, arguments );
+ }
next();
});