aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.effects.core.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-07-25 11:53:14 -0400
committerScott González <scott.gonzalez@gmail.com>2011-07-25 11:53:14 -0400
commit19a9de7e668cdb3b76c3b733d0147f1853cb38a5 (patch)
treea259b421dd77cbec27e55db9b4d1104bf5214a2a /ui/jquery.effects.core.js
parentdaadc343be2f139e82719e2e5ff466aa19ec166f (diff)
parent51ee3be39829e339c8e4bccb532347944e600ca5 (diff)
downloadjquery-ui-19a9de7e668cdb3b76c3b733d0147f1853cb38a5.tar.gz
jquery-ui-19a9de7e668cdb3b76c3b733d0147f1853cb38a5.zip
Merge branch 'master' into core-1.6.1
Conflicts: demos/menubar/default.html tests/unit/autocomplete/autocomplete.html tests/visual/effects/effects.all.html ui/jquery.ui.menu.js ui/jquery.ui.popup.js
Diffstat (limited to 'ui/jquery.effects.core.js')
-rw-r--r--ui/jquery.effects.core.js34
1 files changed, 32 insertions, 2 deletions
diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js
index 7650aa8f4..b08cd6cf4 100644
--- a/ui/jquery.effects.core.js
+++ b/ui/jquery.effects.core.js
@@ -410,7 +410,12 @@ $.extend( $.effects, {
border: "none",
margin: 0,
padding: 0
- });
+ }),
+ // Store the size in case width/height are defined in % - Fixes #5245
+ size = {
+ width: element.width(),
+ height: element.height()
+ };
element.wrap( wrapper );
wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element
@@ -438,6 +443,7 @@ $.extend( $.effects, {
bottom: "auto"
});
}
+ element.css(size);
return wrapper.css( props ).show();
},
@@ -530,6 +536,7 @@ $.fn.extend({
effect: function( effect, options, speed, callback ) {
var args = _normalizeArguments.apply( this, arguments ),
mode = args.mode,
+ queue = args.queue,
effectMethod = $.effects.effect[ args.effect ],
// DEPRECATED: remove in 2.0 (#7115)
@@ -548,9 +555,32 @@ $.fn.extend({
}
}
+ function run( next ) {
+ var elem = $( this ),
+ complete = args.complete,
+ mode = args.mode;
+
+ function done() {
+ if ( $.isFunction( complete ) ) {
+ complete.call( elem[0] );
+ }
+ if ( $.isFunction( next ) ) {
+ next();
+ }
+ }
+
+ // 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
if ( effectMethod ) {
- return effectMethod.call( this, args );
+ return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
} else {
// DEPRECATED: remove in 2.0 (#7115)
return oldEffectMethod.call(this, {