Skip to content

Commit 5cff6e4

Browse files
committed
jQuery.widget: Adding the only logical example I can think of for _init().
1 parent 9daa400 commit 5cff6e4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

entries/jQuery.widget.xml

+11-1
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,16 @@ _getCreateOptions: function() {
240240

241241
<p><em>Note: Initialization should only be handled if there is a logical action to perform on successive calls to the widget with no arguments.</em></p>
242242
</desc>
243+
<example>
244+
<desc>Call the <code>open()</code> method if the <code>autoOpen</code> option is set.</desc>
245+
<code><![CDATA[
246+
_init: function() {
247+
if ( this.options.autoOpen ) {
248+
this.open();
249+
}
250+
}
251+
]]></code>
252+
</example>
243253
</method>
244254
<method name="_setOptions">
245255
<desc>
@@ -337,7 +347,7 @@ this._delay( this._foo, 100 );
337347
<desc>The element(s) to apply the hoverable behavior to.</desc>
338348
</argument>
339349
<example>
340-
<desc>Apply the <code>ui-state-hover</code> class to all <code>&lt;div&gt;</code>s within the element on hover.</desc>
350+
<desc>Apply hoverable styling to all <code>&lt;div&gt;</code>s within the element on hover.</desc>
341351
<code><![CDATA[
342352
this._hoverable( this.element.find( "div" ) );
343353
]]></code>

0 commit comments

Comments
 (0)