aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.widget.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2011-05-02 13:11:58 +0200
committerJörn Zaefferer <joern.zaefferer@gmail.com>2011-05-02 13:11:58 +0200
commita03c222f05aa2364189d264377e0a19da4d4c9ad (patch)
tree9dbc9ba987a02504d99792d0728b6a8154089937 /ui/jquery.ui.widget.js
parent3bb9ab262670328de9eb9a97892e9cf85c55c7d9 (diff)
downloadjquery-ui-a03c222f05aa2364189d264377e0a19da4d4c9ad.tar.gz
jquery-ui-a03c222f05aa2364189d264377e0a19da4d4c9ad.zip
Tooltip: Overhaul widget animations code to allow delay with plain show/hide
Diffstat (limited to 'ui/jquery.ui.widget.js')
-rw-r--r--ui/jquery.ui.widget.js21
1 files changed, 16 insertions, 5 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js
index 9634eaa1f..a5c59ad3c 100644
--- a/ui/jquery.ui.widget.js
+++ b/ui/jquery.ui.widget.js
@@ -365,12 +365,23 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
if ( hasOptions && $.effects && $.effects[ effectName ] ) {
element[ method ]( options );
} else if ( element[ effectName ] ) {
- element[ effectName ]( options.duration, options.easing, callback );
- } else {
- element[ method ]();
- if ( callback ) {
- callback.call( element[ 0 ] );
+ if ( /show|hide/.test( effectName ) ) {
+ element.queue( function() {
+ element[ effectName ]();
+ if ( callback ) {
+ callback.call( element[ 0 ] );
+ }
+ });
+ } else {
+ element[ effectName ]( options.duration, options.easing, callback );
}
+ } else {
+ element.queue( function() {
+ $( this )[ method ]();
+ if ( callback ) {
+ callback.call( element[ 0 ] );
+ }
+ });
}
};
});