Skip to content

Commit

Permalink
jQuery.widget: Final updates to widget method examples. Fixes #76.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjvantoll committed Oct 8, 2013
1 parent 46143c2 commit 3139dbf
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions entries/jQuery.widget.xml
Expand Up @@ -475,14 +475,13 @@ this._off( this.element, "click" );
Invokes the method of the same name from the parent widget, with any specified arguments. Essentially <code>.call()</code>.
</desc>
<example>
<desc>Handle the width option and call the parent widget's <code>_setOption()</code> method to handle all other options.</desc>
<desc>Handle <code>title</code> option updates and call the parent widget's <code>_setOption()</code> to update the internal storage of the option.</desc>
<code><![CDATA[
_setOption: function( key, value ) {
if ( key === "width" ) {
this.resize();
} else {
this._super( key, value );
if ( key === "title" ) {
this.element.find( "h3" ).text( value );
}
this._super( key, value );
}
]]></code>
</example>
Expand All @@ -495,14 +494,13 @@ _setOption: function( key, value ) {
<desc>Array of arguments to pass to the parent method.</desc>
</argument>
<example>
<desc>Handle the width option and call the parent widget's <code>_setOption()</code> method to handle all other options.</desc>
<desc>Handle <code>title</code> option updates and call the parent widget's <code>_setOption()</code> to update the internal storage of the option.</desc>
<code><![CDATA[
_setOption: function( key, value ) {
if ( key === "width" ) {
this.resize();
} else {
this._superApply( arguments );
if ( key === "title" ) {
this.element.find( "h3" ).text( value );
}
this._superApply( arguments );
}
]]></code>
</example>
Expand Down Expand Up @@ -636,7 +634,7 @@ this._show( this.element, this.options.show, function() {
this._hide( this.element, this.options.hide, function() {
// Remove the element from the DOM when it's fully hidden.
this.remove();
$( this ).remove();
});
]]></code>
</example>
Expand Down

0 comments on commit 3139dbf

Please sign in to comment.