r112886 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112885‎ | r112886 | r112887 >
Date:13:16, 2 March 2012
Author:jdlrobson
Status:resolved (Comments)
Tags:
Comment:
make sure toggling is enabled

some older browsers
e.g. nokia e63 do not support various operations
for getting elements
see http://www.quirksmode.org/m/w3c_core.html

currently using document.querySelectorAll
which means for these browsers sections will be hidden
but no buttons added
this change checks for this situation
making sure the information is still accessible

going forward to support toggling on these browses
we could add the Sizzle library but it would increase the size of the page
Modified paths:
  • /trunk/extensions/MobileFrontend/javascripts/application.js (modified) (history)
  • /trunk/extensions/MobileFrontend/stylesheets/beta_common.css (modified) (history)
  • /trunk/extensions/MobileFrontend/stylesheets/common.css (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/javascripts/application.js
@@ -22,6 +22,10 @@
2323 btn.style.display = visible ? 'inline-block' : 'none';
2424 return btn;
2525 }
 26+ if(!sectionHeadings) {
 27+ sectionHeadings = [];
 28+ utilities( document.body ).addClass( 'togglingEnabled' );
 29+ }
2630 for( i = 0; i < sectionHeadings.length; i++ ) {
2731 heading = sectionHeadings[i];
2832 heading.insertBefore( createButton( true ), heading.firstChild );
Index: trunk/extensions/MobileFrontend/stylesheets/common.css
@@ -334,12 +334,12 @@
335335 display: none;
336336 }
337337
338 -.jsEnabled button.show {
 338+.togglingEnabled button.show {
339339 display: inline-block;
340340 }
341341
342 -.jsEnabled .content_block,
343 -.jsEnabled .section_anchors,
 342+.togglingEnabled .content_block,
 343+.togglingEnabled .section_anchors,
344344 button.section_heading.hide {
345345 display: none;
346346 }
Index: trunk/extensions/MobileFrontend/stylesheets/beta_common.css
@@ -342,12 +342,12 @@
343343 display: none;
344344 }
345345
346 -.jsEnabled button.show {
 346+.togglingEnabled button.show {
347347 display: inline-block;
348348 }
349349
350 -.jsEnabled .content_block,
351 -.jsEnabled .section_anchors,
 350+.togglingEnabled .content_block,
 351+.togglingEnabled .section_anchors,
352352 button.section_heading.hide {
353353 display: none;
354354 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r112889amendment to r112886...jdlrobson13:28, 2 March 2012
r112959apply fix in r112886 to beta_...jdlrobson19:27, 3 March 2012

Comments

#Comment by Jdlrobson (talk | contribs)   13:28, 2 March 2012

Please see r112889 - mistake in this commit.

Status & tagging log