r88614 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88613‎ | r88614 | r88615 >
Date:22:50, 22 May 2011
Author:krinkle
Status:ok
Tags:
Comment:
Optimization jquery.spinner.js:
* In prototype functions this refers to the main object (hence 'return this;' at the end), no need to initialize a jQuery object ike ( this );
* Using .length instead of casting a boolean (which may not work as expected)
Modified paths:
  • /trunk/extensions/UploadWizard/resources/jquery/jquery.spinner.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/jquery/jquery.spinner.js
@@ -3,10 +3,9 @@
44 * Set a given selector html to the loading spinner:
55 */
66 $.fn.loadingSpinner = function( ) {
7 - if ( this ) {
8 - $j( this ).html(
9 - $j( '<div />' )
10 - .addClass( "loadingSpinner" )
 7+ if ( this.length ) {
 8+ this.html(
 9+ $j( '<div />' ).addClass( 'loadingSpinner' )
1110 );
1211 }
1312 return this;

Status & tagging log