r16963 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16962‎ | r16963 | r16964 >
Date:08:15, 12 October 2006
Author:simetrical
Status:old
Tags:
Comment:
Fix wikibits.js script broken by last commit. That tweaked DOM: editsections are now spans instead of divs and are inside the h# tags, so JavaScript etc. that relies on their being divs will break briefly. However, this is the logical approach, since it will attach the editsection to the header naturally, including auto-centering etc.
Modified paths:
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/wikibits.js
@@ -503,9 +503,9 @@
504504
505505 function setupRightClickEdit() {
506506 if (document.getElementsByTagName) {
507 - var divs = document.getElementsByTagName('div');
508 - for (var i = 0; i < divs.length; i++) {
509 - var el = divs[i];
 507+ var spans = document.getElementsByTagName('span');
 508+ for (var i = 0; i < spans.length; i++) {
 509+ var el = spans[i];
510510 if(el.className == 'editsection') {
511511 addRightClickEditHandler(el);
512512 }