Skip to content

Commit 207d89c

Browse files
committed
Widget: Rename _bind to _on and add _off. Slighly update description. Fixes jquery#3 - Widget docs
1 parent 7d7c0b0 commit 207d89c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

entries/widget.xml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<longdesc>
66
<p>You can create new widgets from scratch, using just the <code>$.Widget</code> object as base to inherit from, or you can explicitly inherit from existing jQuery UI or third-party widgets. Defining a widget with the same name as you inherit from even allows you to extend widgets in place.</p>
77

8-
<p>More details at <a href="https://github.com/scottgonzalez/widget-factory-docs/">https://github.com/scottgonzalez/widget-factory-docs/</a></p>
8+
<p>For now, more details can be found at <a href="https://github.com/scottgonzalez/widget-factory-docs/">github.com/scottgonzalez/widget-factory-docs/</a></p>
99
</longdesc>
1010
<signature returns="jQuery">
1111
<desc>Initialize the widget.</desc>
@@ -77,17 +77,25 @@
7777
<argument name="key" type="String"></argument>
7878
<argument name="value" type="Object"></argument>
7979
</method>
80-
<method name="_bind">
80+
<method name="_on">
8181
<desc>
82-
Binds events to the specified element. If no element is specified then this.element is used.
83-
<p><code>handlers</code> is a hash of event names and event handlers. Delegation is supported via selectors inside the event names, e.g., "<code>click .foo</code>".</p>
82+
Binds events to the specified element. If no element is specified then <code>this.element</code> is used.
83+
<p><code>handlers</code> is an object of event names and event handlers. Delegation is supported via selectors inside the event names, e.g., "<code>click .foo</code>".</p>
8484
<p>Maintains proper <code>this</code> context inside the handlers.</p>
8585
<p>Automatically handles disabled widgets: If the widget is disabled or the event occurs on an element with the <code>ui-state-disabled</code> class, the event handler is not invoked.</p>
8686
<p>Event handlers are automatically namespaced and cleaned up on destroy. </p>
8787
</desc>
8888
<argument name="element" type="jQuery" optional="true"></argument>
8989
<argument name="handlers" type="Object"></argument>
9090
</method>
91+
<method name="_off">
92+
<desc>
93+
Unbinds events from the specified element (required, unlike <code>_on</code>).
94+
<p><code>eventName</code> is a string of one or more space-separated events to remove. The widget's event namespace is appended to each when removing events. </p>
95+
</desc>
96+
<argument name="element" type="jQuery"></argument>
97+
<argument name="eventName" type="String"></argument>
98+
</method>
9199
<method name="_super">
92100
<desc>Invoke the method of the same name from the parent widget, with any specified arguments. Essentially <code>.call()</code>.</desc>
93101
</method>

0 commit comments

Comments
 (0)