Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Widget: Initialize implemenetation for _show() and _hide() to support…

… animations across plugins.
  • Loading branch information...
commit 5359ffb5cc0b5dd4216a26543b8d57236827af69 1 parent 31a181a
@scottgonzalez scottgonzalez authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 ui/jquery.ui.widget.js
View
20 ui/jquery.ui.widget.js
@@ -336,4 +336,24 @@ $.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 ( hasOptions && element[ effectName ] ) {
+ element[ effectName ]( options.duration, options.easing, callback );
+ } else {
+ element[ method ]();
+ if ( callback ) {
+ callback.call( element[ 0 ] );
+ }
+ }
+ };
+});
+
})( jQuery );
Please sign in to comment.
Something went wrong with that request. Please try again.