From 3a0b617bb44565aacfa90c2ee20b293654d911c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Sat, 22 Jan 2011 20:30:40 -0500 Subject: [PATCH] Widget: Added ability to generate an item if no item is passed on creation. --- ui/jquery.ui.widget.js | 2 ++ 1 file changed, 2 insertions(+) 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: "
", 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 ); -- 2.39.5