aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.effects.core.js
diff options
context:
space:
mode:
authorgnarf <gnarf@gnarf.net>2011-06-21 01:11:46 -0500
committergnarf <gnarf@gnarf.net>2011-06-21 01:18:19 -0500
commitab627e03a6a37cbf3291e9600f5482bd50991360 (patch)
treecda0933741895ef198be19813cb45168889ea78f /ui/jquery.effects.core.js
parent65a6c46e5568c43a9df9505e23da6a766814557e (diff)
downloadjquery-ui-ab627e03a6a37cbf3291e9600f5482bd50991360.tar.gz
jquery-ui-ab627e03a6a37cbf3291e9600f5482bd50991360.zip
Effects.*: DRY the complete callback execution into the 'done' callback passed into an effect
Diffstat (limited to 'ui/jquery.effects.core.js')
-rw-r--r--ui/jquery.effects.core.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js
index 87fc5a074..330ddd83c 100644
--- a/ui/jquery.effects.core.js
+++ b/ui/jquery.effects.core.js
@@ -556,7 +556,19 @@ $.fn.extend({
}
function run( next ) {
- effectMethod.call( this, args, $.isFunction( next ) ? next : $.noop );
+ var elem = this,
+ complete = args.complete;
+
+ function done() {
+ if ( $.isFunction( complete ) ) {
+ complete.call( elem );
+ }
+ if ( $.isFunction( next ) ) {
+ next();
+ }
+ }
+
+ effectMethod.call( elem, args, done );
}
// TODO: remove this check in 2.0, effectMethod will always be true