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