r114369 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114368‎ | r114369 | r114370 >
Date:13:53, 21 March 2012
Author:nikerabbit
Status:resolved
Tags:
Comment:
Get rid of onclick, ping comments in r113616
Tested manually
Modified paths:
  • /trunk/extensions/Translate/resources/ext.translate.special.languagestats.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/resources/ext.translate.special.languagestats.js
@@ -31,10 +31,10 @@
3232
3333 // Build toggle link
3434 var $toggler = $( '<span class="groupexpander collapsed">[</span>' )
35 - .append( $( '<a href="#" onclick="return false;"></a>' )
 35+ .append( $( '<a href="#"></a>' )
3636 .text( mw.msg( 'translate-langstats-expand' ) ) )
3737 .append( ']' )
38 - .click( function() {
 38+ .click( function( e ) {
3939 var $el = $( this );
4040 // Switch the state and toggle the rows
4141 if ( $el.hasClass( 'collapsed' ) ) {
@@ -46,6 +46,8 @@
4747 $el.addClass( 'collapsed' ).removeClass( 'expanded' );
4848 $el.find( '> a' ).text( mw.msg( 'translate-langstats-expand' ) );
4949 }
 50+
 51+ e.preventDefault();
5052 } );
5153
5254 // Add the toggle link to the first cell of the meta group table-row
@@ -66,10 +68,10 @@
6769 $allChildRows = $( 'tr[data-parentgroup]', $translateTable ),
6870 $allToggles_cache = null,
6971 $toggleAllButton = $( '<span class="collapsed">[</span>' )
70 - .append( $( '<a href="#" onclick="return false;"></a>' )
 72+ .append( $( '<a href="#""></a>' )
7173 .text( mw.msg( 'translate-langstats-expandall' ) ) )
7274 .append( ']' )
73 - .click( function() {
 75+ .click( function( e ) {
7476 var
7577 $el = $( this ),
7678 $allToggles = !!$allToggles_cache ? $allToggles_cache : $( '.groupexpander', $translateTable );
@@ -86,6 +88,8 @@
8789 $el.find( '> a' ).text( mw.msg( 'translate-langstats-expandall' ) );
8890 $allToggles.find( '> a' ).text( mw.msg( 'translate-langstats-expand' ) );
8991 }
 92+
 93+ e.preventDefault();
9094 } );
9195
9296 // Initially hide them

Follow-up revisions

RevisionCommit summaryAuthorDate
r114370Fix typo from r114369nikerabbit14:02, 21 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113616Improved and cleaned up Special:LanguageStats JavaScript to support collapsin...nikerabbit12:14, 12 March 2012

Status & tagging log