Skip to content

Commit 5359ffb

Browse files
committed
Widget: Initialize implemenetation for _show() and _hide() to support animations across plugins.
1 parent 31a181a commit 5359ffb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

ui/jquery.ui.widget.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,4 +336,24 @@ $.Widget.prototype = {
336336
}
337337
};
338338

339+
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
340+
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
341+
options = options || {};
342+
var hasOptions = !$.isEmptyObject( options ),
343+
effectName = options.effect || defaultEffect;
344+
options.complete = callback;
345+
346+
if ( hasOptions && $.effects && $.effects[ effectName ] ) {
347+
element[ method ]( options );
348+
} else if ( hasOptions && element[ effectName ] ) {
349+
element[ effectName ]( options.duration, options.easing, callback );
350+
} else {
351+
element[ method ]();
352+
if ( callback ) {
353+
callback.call( element[ 0 ] );
354+
}
355+
}
356+
};
357+
});
358+
339359
})( jQuery );

0 commit comments

Comments
 (0)