From: Trevor Parscal Date: Fri, 17 Jul 2009 22:49:27 +0000 (+0000) Subject: Fixes bug 19506 by searching through a few more containers for links which need updat... X-Git-Tag: 1.31.0-rc.0~40861 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/rappels.php?a=commitdiff_plain;h=6f6e590d7516f4bc0c315d461bcc8df4672f92f2;p=lhc%2Fweb%2Fwiklou.git Fixes bug 19506 by searching through a few more containers for links which need updateTooltipAccessKeys to be run on them. --- 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") );