r57836 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57835‎ | r57836 | r57837 >
Date:23:46, 16 October 2009
Author:tparscal
Status:resolved (Comments)
Tags:
Comment:
Changed click handlers to mousedown - improves precieved performance.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js
@@ -326,25 +326,23 @@
327327 .text( label )
328328 .attr( 'rel', id )
329329 .data( 'context', context )
330 - .click(
331 - function() {
332 -
333 - $(this).parent().parent().find( '.page' ).hide();
334 - $(this).parent().parent().find( '.page-' + $(this).attr( 'rel' ) ).show();
335 - $(this).siblings().removeClass( 'current' );
336 - $(this).addClass( 'current' );
337 - var section = $(this).parent().parent().attr( 'rel' );
338 -
339 - //click tracking
340 - if($.trackAction != undefined){
341 - $.trackAction(section + '.' + $(this).attr('rel'));
342 - }
343 -
344 - $.cookie(
345 - 'wikiEditor-' + $(this).data( 'context' ).instance + '-booklet-' + section + '-page',
346 - $(this).attr( 'rel' )
347 - );
348 - } );
 330+ .bind( 'mousedown', function() {
 331+ $(this).parent().parent().find( '.page' ).hide();
 332+ $(this).parent().parent().find( '.page-' + $(this).attr( 'rel' ) ).show();
 333+ $(this).siblings().removeClass( 'current' );
 334+ $(this).addClass( 'current' );
 335+ var section = $(this).parent().parent().attr( 'rel' );
 336+
 337+ //click tracking
 338+ if($.trackAction != undefined){
 339+ $.trackAction(section + '.' + $(this).attr('rel'));
 340+ }
 341+
 342+ $.cookie(
 343+ 'wikiEditor-' + $(this).data( 'context' ).instance + '-booklet-' + section + '-page',
 344+ $(this).attr( 'rel' )
 345+ );
 346+ } );
349347 },
350348 buildPage : function( context, id, page ) {
351349 var $page = $( '<div />' ).attr( {
@@ -451,7 +449,7 @@
452450 .attr( 'href', '#' )
453451 .text( $.wikiEditor.autoMsg( section, 'label' ) )
454452 .data( 'context', context )
455 - .click( function() {
 453+ .bind( 'mousedown', function() {
456454 var $sections = $(this).data( 'context' ).$ui.find( '.sections' );
457455 var $section =
458456 $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r58253EditToolbar: (bug 21323) Clicking tabs makes browser jump to top of page; reg...catrope12:05, 28 October 2009
r58448Fixes regression in r57836 which changed the event from click to mousedown - ...tparscal22:45, 2 November 2009
r59204wmf-deployment: Merging usability changes from trunk...catrope18:53, 18 November 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   22:37, 2 November 2009

Minor regression: this activates the folding/unfolding on right- and middle-click as well as left-click. Trevor's looking into poking to filter by button so it behaves nicer.

Status & tagging log