r113812 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113811‎ | r113812 | r113813 >
Date:15:20, 14 March 2012
Author:jdlrobson
Status:ok
Tags:
Comment:
allow sections to be non-numbers

the footer would like to introduce a section
that can be toggled. This allows us to give it a name
other than a number so it doesn't interfere with
article body sections
Modified paths:
  • /trunk/extensions/MobileFrontend/javascripts/toggle.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/javascripts/toggle.js
@@ -15,9 +15,9 @@
1616 }
1717
1818 function openSectionHandler() {
19 - var sectionNumber = this.id ? this.id.split( '_' )[1] : -1;
20 - if( sectionNumber > -1 ) {
21 - wm_toggle_section( sectionNumber );
 19+ var sectionName = this.id ? this.id.split( '_' )[1] : -1;
 20+ if( sectionName !== -1 ) {
 21+ wm_toggle_section( sectionName );
2222 }
2323 }
2424 function createButton( visible ) {

Status & tagging log