r111638 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111637‎ | r111638 | r111639 >
Date:13:42, 16 February 2012
Author:jdlrobson
Status:ok
Tags:
Comment:
swap out javascript orientation styling for media query

note: this only effects iphones where javascript has
been disabled in safari
Modified paths:
  • /trunk/extensions/MobileFrontend/javascripts/application.js (modified) (history)
  • /trunk/extensions/MobileFrontend/stylesheets/iphone.css (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/javascripts/application.js
@@ -71,30 +71,9 @@
7272 wm_reveal_for_hash( document.location.hash );
7373 }
7474
75 -updateOrientation();
76 -
7775 // Try to scroll and hide URL bar
7876 window.scrollTo( 0, 1 );
7977
80 -/**
81 - * updateOrientation checks the current orientation, sets the body's class
82 - * attribute to portrait, landscapeLeft, or landscapeRight,
83 - * and displays a descriptive message on "Handling iPhone or iPod touch Orientation Events".
84 - */
85 -function updateOrientation() {
86 - switch( window.orientation ) {
87 - case 0:
88 - document.body.setAttribute( 'class', 'portrait' );
89 - break;
90 - case 90:
91 - case -90:
92 - document.body.setAttribute( 'class', 'landscape' );
93 - }
94 -}
95 -
96 -// Point to the updateOrientation function when iPhone switches between portrait and landscape modes.
97 -window.onorientationchange = updateOrientation;
98 -
9978 function wm_reveal_for_hash( hash ) {
10079 var targetel = document.getElementById( hash.substr(1) );
10180 if ( targetel ) {
Index: trunk/extensions/MobileFrontend/stylesheets/iphone.css
@@ -350,14 +350,15 @@
351351 font-size: 16px;
352352 }
353353
354 -body.landscape #searchbox {
355 - width: 450px;
 354+@media all and (orientation:landscape) {
 355+ #searchbox {
 356+ width: 450px;
 357+ }
 358+ #searchbox #searchField {
 359+ width: 375px;
 360+ }
356361 }
357362
358 -body.landscape #searchbox #searchField {
359 - width: 375px;
360 -}
361 -
362363 #header {
363364 max-width: 290px;
364365 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r111649mimic behaviour in beta_ introduced in r111638jdlrobson16:49, 16 February 2012

Status & tagging log