diff options
author | jzaefferer <joern.zaefferer@gmail.com> | 2011-04-15 16:49:29 +0200 |
---|---|---|
committer | jzaefferer <joern.zaefferer@gmail.com> | 2011-04-15 16:49:29 +0200 |
commit | e609bebaae7f3f762dd61d92fb0529af9ef5f2d1 (patch) | |
tree | c56d909729fcb85242ca261542f1ebf5971da9f2 /ui/jquery.ui.widget.js | |
parent | 00559b388af76424878413cedcebee49e0a8c67e (diff) | |
download | jquery-ui-e609bebaae7f3f762dd61d92fb0529af9ef5f2d1.tar.gz jquery-ui-e609bebaae7f3f762dd61d92fb0529af9ef5f2d1.zip |
Custom tooltip animations based on widget-animations branch.
Diffstat (limited to 'ui/jquery.ui.widget.js')
-rw-r--r-- | ui/jquery.ui.widget.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index 27d08ccd2..9593c1eaf 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -353,6 +353,26 @@ $.Widget.prototype = { } }; +$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { + $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { + options = options || {}; + var hasOptions = !$.isEmptyObject( options ), + effectName = options.effect || defaultEffect; + options.complete = callback; + + 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 ] ); + } + } + }; +}); + // DEPRECATED if ( $.uiBackCompat !== false ) { $.Widget.prototype._getCreateOptions = function() { |