From 6f6e590d7516f4bc0c315d461bcc8df4672f92f2 Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Fri, 17 Jul 2009 22:49:27 +0000 Subject: [PATCH] Fixes bug 19506 by searching through a few more containers for links which need updateTooltipAccessKeys to be run on them. --- skins/common/wikibits.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js index ec92e9db9a..8b4ab554d0 100644 --- a/skins/common/wikibits.js +++ b/skins/common/wikibits.js @@ -227,10 +227,19 @@ var tooltipAccessKeyRegexp = /\[(ctrl-)?(alt-)?(shift-)?(esc-)?(.)\]$/; */ function updateTooltipAccessKeys( nodeList ) { if ( !nodeList ) { - // skins without a "column-one" element don't seem to have links with accesskeys either - var columnOne = document.getElementById("column-one"); - if ( columnOne ) - updateTooltipAccessKeys( columnOne.getElementsByTagName("a") ); + // Rather than scan all links on the whole page, we can just scan these + // containers which contain the relevant links. This is really just an + // optimization technique. + var linkContainers = [ + "column-one", // Monobook and Modern + "head", "panel", "p-logo" // Vector + ]; + for ( var i in linkContainers ) { + var linkContainer = document.getElementById( linkContainers[i] ); + if ( linkContainer ) { + updateTooltipAccessKeys( linkContainer.getElementsByTagName("a") ); + } + } // these are rare enough that no such optimization is needed updateTooltipAccessKeys( document.getElementsByTagName("input") ); updateTooltipAccessKeys( document.getElementsByTagName("label") ); -- 2.20.1