mirror of
https://github.com/jquery/jquery-ui.git
synced 2026-04-20 03:02:41 -04:00
Widget: Added ability to generate an item if no item is passed on creation.
This commit is contained in:
2
ui/jquery.ui.widget.js
vendored
2
ui/jquery.ui.widget.js
vendored
@@ -116,10 +116,12 @@ $.Widget = function( options, element ) {
|
||||
$.Widget.prototype = {
|
||||
widgetName: "widget",
|
||||
widgetEventPrefix: "",
|
||||
defaultElement: "<div>",
|
||||
options: {
|
||||
disabled: false
|
||||
},
|
||||
_createWidget: function( options, element ) {
|
||||
element = $( element || this.defaultElement )[ 0 ];
|
||||
// $.widget.bridge stores the plugin instance, but we do it anyway
|
||||
// so that it's stored even before the _create function runs
|
||||
$.data( element, this.widgetName, this );
|
||||
|
||||
Reference in New Issue
Block a user