Skip to content
Permalink
Browse files

Widget Factory: Make $.widget return the constructor. Fixes #9467 - W…

…idget factory: Return the constructor from $.widget().
  • Loading branch information...
arschmitz authored and scottgonzalez committed Jul 31, 2013
1 parent c4c90f3 commit c0ab71056b936627e8a7821f03c044aec6280a40
Showing with 5 additions and 2 deletions.
  1. +3 −2 tests/unit/widget/widget_core.js
  2. +2 −0 ui/jquery.ui.widget.js
@@ -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() {
@@ -134,6 +134,8 @@ $.widget = function( name, base, prototype ) {
}

$.widget.bridge( name, constructor );

return constructor;
};

$.widget.extend = function( target ) {

0 comments on commit c0ab710

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.