aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorCorey Frang <gnarf@gnarf.net>2011-06-23 07:22:34 -0500
committerCorey Frang <gnarf@gnarf.net>2011-06-23 07:22:34 -0500
commitd18cd7ed0f41213aca9f29ae67c360ca6b21abfa (patch)
tree81cd6ee8279ec81d4ac85ac2dc24905d237320a1 /ui
parenta89ff4098a6149817061a752ec3755127f554407 (diff)
downloadjquery-ui-d18cd7ed0f41213aca9f29ae67c360ca6b21abfa.tar.gz
jquery-ui-d18cd7ed0f41213aca9f29ae67c360ca6b21abfa.zip
Effects.core: Check Visibility vs 'hide' and 'show' modes, finish immediately if neccessary - Fixes #6715 - Hide and Show try to affect hidden and showing elements
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.effects.core.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js
index 330ddd83c..b08cd6cf4 100644
--- a/ui/jquery.effects.core.js
+++ b/ui/jquery.effects.core.js
@@ -556,19 +556,26 @@ $.fn.extend({
}
function run( next ) {
- var elem = this,
- complete = args.complete;
+ var elem = $( this ),
+ complete = args.complete,
+ mode = args.mode;
function done() {
if ( $.isFunction( complete ) ) {
- complete.call( elem );
+ complete.call( elem[0] );
}
if ( $.isFunction( next ) ) {
next();
}
}
- effectMethod.call( elem, args, done );
+ // if the element is hiddden and mode is hide,
+ // or element is visible and mode is show
+ if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
+ done();
+ } else {
+ effectMethod.call( elem[0], args, done );
+ }
}
// TODO: remove this check in 2.0, effectMethod will always be true