184
184
<desc >Destroy the widget when any of its anchors are clicked.</desc >
185
185
<code ><![CDATA[
186
186
this._on( this.element, {
187
- "click a": function( event ) {
188
- event.preventDefault();
189
- this.destroy();
190
- }
187
+ "click a": function( event ) {
188
+ event.preventDefault();
189
+ this.destroy();
190
+ }
191
191
});
192
192
]]> </code >
193
193
</example >
@@ -275,19 +275,19 @@ _init: function() {
275
275
<desc >Call a <code >resize()</code > method if the <code >height</code > or <code >width</code > options change.</desc >
276
276
<code ><![CDATA[
277
277
_setOptions: function( options ) {
278
- var that = this,
279
- resize = false;
280
-
281
- $.each( options, function( key, value ) {
282
- that._setOption( key, value );
283
- if ( key === "height" || key === "width" ) {
284
- resize = true;
285
- }
286
- });
287
-
288
- if ( resize ) {
289
- this.resize();
290
- }
278
+ var that = this,
279
+ resize = false;
280
+
281
+ $.each( options, function( key, value ) {
282
+ that._setOption( key, value );
283
+ if ( key === "height" || key === "width" ) {
284
+ resize = true;
285
+ }
286
+ });
287
+
288
+ if ( resize ) {
289
+ this.resize();
290
+ }
291
291
}
292
292
]]> </code >
293
293
</example >
@@ -309,13 +309,13 @@ _setOptions: function( options ) {
309
309
<desc >Update a widget's element when its <code >height</code > or <code >width</code > option changes.</desc >
310
310
<code ><![CDATA[
311
311
_setOption: function( key, value ) {
312
- if ( key === "width" ) {
313
- this.element.width( value );
314
- }
315
- if ( key === "height" ) {
316
- this.element.height( value );
317
- }
318
- this._super( key, value );
312
+ if ( key === "width" ) {
313
+ this.element.width( value );
314
+ }
315
+ if ( key === "height" ) {
316
+ this.element.height( value );
317
+ }
318
+ this._super( key, value );
319
319
}
320
320
]]> </code >
321
321
</example >
@@ -344,9 +344,9 @@ _setOption: function( key, value ) {
344
344
<desc >Prevent the default action of all links clicked within the widget's element.</desc >
345
345
<code ><![CDATA[
346
346
this._on( this.element, {
347
- "click a": function( event ) {
348
- event.preventDefault();
349
- }
347
+ "click a": function( event ) {
348
+ event.preventDefault();
349
+ }
350
350
});
351
351
]]> </code >
352
352
</example >
@@ -378,11 +378,11 @@ this._off( this.element, "click" );
378
378
<desc >Handle the width option and call the parent widget's <code >_setOption()</code > method to handle all other options.</desc >
379
379
<code ><![CDATA[
380
380
_setOption: function( key, value ) {
381
- if ( key === "width" ) {
382
- this.resize();
383
- } else {
384
- this._super( key, value );
385
- }
381
+ if ( key === "width" ) {
382
+ this.resize();
383
+ } else {
384
+ this._super( key, value );
385
+ }
386
386
}
387
387
]]> </code >
388
388
</example >
@@ -398,11 +398,11 @@ _setOption: function( key, value ) {
398
398
<desc >Handle the width option and call the parent widget's <code >_setOption()</code > method to handle all other options.</desc >
399
399
<code ><![CDATA[
400
400
_setOption: function( key, value ) {
401
- if ( key === "width" ) {
402
- this.resize();
403
- } else {
404
- this._superApply( arguments );
405
- }
401
+ if ( key === "width" ) {
402
+ this.resize();
403
+ } else {
404
+ this._superApply( arguments );
405
+ }
406
406
}
407
407
]]> </code >
408
408
</example >
@@ -511,8 +511,8 @@ this._on( this.element, {
511
511
<code ><![CDATA[
512
512
this._show( this.element, this.options.show, function() {
513
513
514
- // Focus an item when the element is fully visible
515
- this.mainElement. focus();
514
+ // Focus the element when it's fully visible.
515
+ this.focus();
516
516
}]]> </code >
517
517
</example >
518
518
</method >
@@ -535,8 +535,8 @@ this._show( this.element, this.options.show, function() {
535
535
<code ><![CDATA[
536
536
this._hide( this.element, this.options.hide, function() {
537
537
538
- // Trigger a close event when the element is fully hidden
539
- this._trigger( "close" );
538
+ // Remove the element from the DOM when it's fully hidden.
539
+ this.remove( );
540
540
});
541
541
]]> </code >
542
542
</example >
0 commit comments