r53427 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53426‎ | r53427 | r53428 >
Date:22:49, 17 July 2009
Author:tparscal
Status:ok
Tags:
Comment:
Fixes bug 19506 by searching through a few more containers for links which need updateTooltipAccessKeys to be run on them.
Modified paths:
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/wikibits.js
@@ -227,10 +227,19 @@
228228 */
229229 function updateTooltipAccessKeys( nodeList ) {
230230 if ( !nodeList ) {
231 - // skins without a "column-one" element don't seem to have links with accesskeys either
232 - var columnOne = document.getElementById("column-one");
233 - if ( columnOne )
234 - updateTooltipAccessKeys( columnOne.getElementsByTagName("a") );
 231+ // Rather than scan all links on the whole page, we can just scan these
 232+ // containers which contain the relevant links. This is really just an
 233+ // optimization technique.
 234+ var linkContainers = [
 235+ "column-one", // Monobook and Modern
 236+ "head", "panel", "p-logo" // Vector
 237+ ];
 238+ for ( var i in linkContainers ) {
 239+ var linkContainer = document.getElementById( linkContainers[i] );
 240+ if ( linkContainer ) {
 241+ updateTooltipAccessKeys( linkContainer.getElementsByTagName("a") );
 242+ }
 243+ }
235244 // these are rare enough that no such optimization is needed
236245 updateTooltipAccessKeys( document.getElementsByTagName("input") );
237246 updateTooltipAccessKeys( document.getElementsByTagName("label") );

Follow-up revisions

RevisionCommit summaryAuthorDate
r54598Merge r53427, r53344 from trunk...brion20:18, 7 August 2009

Status & tagging log