Index: trunk/extensions/MobileFrontend/MobileFormatter.php |
— | — | @@ -338,11 +338,9 @@ |
339 | 339 | 'section_id' => $this->headings ), |
340 | 340 | $hide ); |
341 | 341 | if ( $this->expandableSections ) { |
342 | | - $h2OnClick = 'javascript:wm_toggle_section(' . $this->headings . ');'; |
343 | 342 | $base .= Html::openElement( 'h2', |
344 | 343 | array( 'class' => 'section_heading', |
345 | | - 'id' => 'section_' . $this->headings, |
346 | | - 'onclick' => $h2OnClick ) ); |
| 344 | + 'id' => 'section_' . $this->headings ) ); |
347 | 345 | } else { |
348 | 346 | $base .= Html::openElement( 'h2', |
349 | 347 | array( 'class' => 'section_heading', |
Index: trunk/extensions/MobileFrontend/javascripts/beta_application.js |
— | — | @@ -66,6 +66,15 @@ |
67 | 67 | |
68 | 68 | function init() { |
69 | 69 | document.body.className = "jsEnabled"; |
| 70 | + var sectionHeadings = document.getElementsByClassName( 'section_heading' ); |
| 71 | + for( var i = 0; i < sectionHeadings.length; i++ ) { |
| 72 | + sectionHeadings[i].addEventListener( 'click', function() { |
| 73 | + var sectionNumber = this.id ? this.id.split( '_' )[1] : -1; |
| 74 | + if(sectionNumber > -1) { |
| 75 | + wm_toggle_section( sectionNumber ); |
| 76 | + } |
| 77 | + }, false ); |
| 78 | + } |
70 | 79 | initClearSearchLink(); |
71 | 80 | search.onpaste = function() { |
72 | 81 | handleDefaultText(); |
Index: trunk/extensions/MobileFrontend/javascripts/application.js |
— | — | @@ -58,6 +58,15 @@ |
59 | 59 | |
60 | 60 | function init() { |
61 | 61 | document.body.className = "jsEnabled"; |
| 62 | + var sectionHeadings = document.getElementsByClassName( 'section_heading' ); |
| 63 | + for( var i = 0; i < sectionHeadings.length; i++ ) { |
| 64 | + sectionHeadings[i].addEventListener( 'click', function() { |
| 65 | + var sectionNumber = this.id ? this.id.split( '_' )[1] : -1; |
| 66 | + if(sectionNumber > -1) { |
| 67 | + wm_toggle_section( sectionNumber ); |
| 68 | + } |
| 69 | + }, false ); |
| 70 | + } |
62 | 71 | initClearSearchLink(); |
63 | 72 | document.getElementById( 'logo' ).addEventListener( 'click', logoClick ); |
64 | 73 | var dismissNotification = document.getElementById( 'dismiss-notification' ); |