r68007 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68006‎ | r68007 | r68008 >
Date:17:51, 14 June 2010
Author:catrope
Status:ok
Tags:
Comment:
Fix r67544 per CR: cancel event properly in TOC show/hide click handler
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/wikibits.js
@@ -146,7 +146,7 @@
147147 toggleLink.id = 'togglelink';
148148 toggleLink.className = 'internal';
149149 toggleLink.href = '#';
150 - toggleLink.onclick = toggleToc;
 150+ addClickHandler( toggleLink, function( evt ) { toggleToc(); return killEvt( evt ); } );
151151
152152 toggleLink.appendChild( document.createTextNode( tocHideText ) );
153153
@@ -173,6 +173,17 @@
174174 }
175175 }
176176
 177+function killEvt( evt ) {
 178+ evt = evt || window.event || window.Event; // W3C, IE, Netscape
 179+ if ( typeof ( evt.preventDefault ) != 'undefined' ) {
 180+ evt.preventDefault(); // Don't follow the link
 181+ evt.stopPropagation();
 182+ } else {
 183+ evt.cancelBubble = true; // IE
 184+ }
 185+ return false; // Don't follow the link (IE)
 186+}
 187+
177188 function toggleToc() {
178189 var tocmain = document.getElementById( 'toc' );
179190 var toc = document.getElementById('toc').getElementsByTagName('ul')[0];
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1537,7 +1537,7 @@
15381538 * to ensure that client-side caches do not keep obsolete copies of global
15391539 * styles.
15401540 */
1541 -$wgStyleVersion = '289';
 1541+$wgStyleVersion = '290';
15421542
15431543 /**
15441544 * This will cache static pages for non-logged-in users to reduce

Follow-up revisions

RevisionCommit summaryAuthorDate
r680271.16wmf4: Merge Vector and UsabilityInitiative fixes from trunk: r67836, r678...catrope20:25, 14 June 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r67544(bug 23570) Fix an instance of a javascript: link in corecatrope16:19, 7 June 2010

Status & tagging log