mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Widget Factory: Make $.widget return the constructor. Fixes #9467 - Widget factory: Return the constructor from $.widget().
This commit is contained in:
parent
c4c90f385a
commit
c0ab71056b
@ -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() {
|
||||
|
2
ui/jquery.ui.widget.js
vendored
2
ui/jquery.ui.widget.js
vendored
@ -134,6 +134,8 @@ $.widget = function( name, base, prototype ) {
|
||||
}
|
||||
|
||||
$.widget.bridge( name, constructor );
|
||||
|
||||
return constructor;
|
||||
};
|
||||
|
||||
$.widget.extend = function( target ) {
|
||||
|
Loading…
Reference in New Issue
Block a user