r56195 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56194‎ | r56195 | r56196 >
Date:18:13, 11 September 2009
Author:catrope
Status:ok
Tags:
Comment:
NavigableTOC: (bug 20585) Unhighlight section in NTOC when textarea loses focus
Modified paths:
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js
@@ -55,7 +55,7 @@
5656 } );
5757 }
5858 )
59 - .bind( 'mouseup scrollToPosition',
 59+ .bind( 'mouseup scrollToPosition focus',
6060 function( event ) {
6161 var context = $(this).data( 'context' );
6262 $(this).eachAsync( {
@@ -65,15 +65,22 @@
6666 }
6767 } );
6868 }
69 - );
 69+ )
 70+ .blur( function() {
 71+ $.wikiEditor.modules.toc.fn.unhighlight( context );
 72+ });
7073 },
 74+
 75+ unhighlight: function( context ) {
 76+ context.modules.$toc.find( 'a' ).removeClass( 'currentSelection' );
 77+ },
7178 /**
7279 * Highlight the section the cursor is currently within
7380 *
7481 * @param {Object} context
7582 */
7683 update: function( context ) {
77 - context.modules.$toc.find( 'a' ).removeClass( 'currentSelection' );
 84+ $.wikiEditor.modules.toc.fn.unhighlight( context );
7885 var position = context.$textarea.getCaretPosition();
7986 var section = 0;
8087 if ( context.data.outline.length > 0 ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r56421wmf-deployment-work: Merge r56417 (pre-deployment usability fixes) from...catrope17:47, 16 September 2009

Status & tagging log