Index: trunk/phase3/skins/common/wikibits.js |
— | — | @@ -227,10 +227,19 @@ |
228 | 228 | */ |
229 | 229 | function updateTooltipAccessKeys( nodeList ) { |
230 | 230 | 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 | + } |
235 | 244 | // these are rare enough that no such optimization is needed |
236 | 245 | updateTooltipAccessKeys( document.getElementsByTagName("input") ); |
237 | 246 | updateTooltipAccessKeys( document.getElementsByTagName("label") ); |