Widget Factory: Make $.widget return the constructor. Fixes #9467 - Widget factory: Return the constructor from $.widget().

This commit is contained in:
Alexander Schmitz 2013-07-31 15:56:04 -04:00 committed by Scott González
parent c4c90f385a
commit c0ab71056b
2 changed files with 5 additions and 2 deletions

View File

@ -615,12 +615,13 @@ test( ".disable()", function() {
});
test( ".widget() - base", function() {
expect( 1 );
$.widget( "ui.testWidget", {
expect( 2 );
var constructor = $.widget( "ui.testWidget", {
_create: function() {}
});
var div = $( "<div>" ).testWidget();
deepEqual( div[0], div.testWidget( "widget" )[0]);
deepEqual( constructor, $.ui.testWidget, "$.widget returns the constructor" );
});
test( ".widget() - overriden", function() {

View File

@ -134,6 +134,8 @@ $.widget = function( name, base, prototype ) {
}
$.widget.bridge( name, constructor );
return constructor;
};
$.widget.extend = function( target ) {