aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.widget.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-01-22 20:30:40 -0500
committerScott González <scott.gonzalez@gmail.com>2011-01-22 20:30:40 -0500
commit3a0b617bb44565aacfa90c2ee20b293654d911c9 (patch)
treede3ea81baf5cf0ad0a49021eaaa000af86728610 /ui/jquery.ui.widget.js
parentf165c93127495d5041c3d49fa592fddbe8000bd1 (diff)
downloadjquery-ui-3a0b617bb44565aacfa90c2ee20b293654d911c9.tar.gz
jquery-ui-3a0b617bb44565aacfa90c2ee20b293654d911c9.zip
Widget: Added ability to generate an item if no item is passed on creation.
Diffstat (limited to 'ui/jquery.ui.widget.js')
-rw-r--r--ui/jquery.ui.widget.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js
index 59c362838..1b00006a0 100644
--- a/ui/jquery.ui.widget.js
+++ b/ui/jquery.ui.widget.js
@@ -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 );