Widget: Refactored code for re-initialization to reduce file size.

This commit is contained in:
Scott González 2010-08-23 15:35:49 -04:00
parent df786f80eb
commit 1cca969c3c

View File

@ -99,10 +99,7 @@ $.widget.bridge = function( name, object ) {
this.each(function() { this.each(function() {
var instance = $.data( this, name ); var instance = $.data( this, name );
if ( instance ) { if ( instance ) {
if ( options ) { instance.option( options || {} )._init();
instance.option( options );
}
instance._init();
} else { } else {
$.data( this, name, new object( options, this ) ); $.data( this, name, new object( options, this ) );
} }