r101428 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101427‎ | r101428 | r101429 >
Date:23:07, 31 October 2011
Author:preilly
Status:ok
Tags:
Comment:
fix on orientation change issue
Modified paths:
  • /trunk/extensions/MobileFrontend/javascripts/opensearch.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/javascripts/opensearch.js
@@ -59,14 +59,16 @@
6060 }
6161
6262 function updateSearchWidth() {
63 - if ( sq && search && sb && results ) {
 63+ if ( sq && search && sb ) {
6464 var iw = ( document.documentElement.clientWidth ) ? document.documentElement.clientWidth : document.body.clientWidth;
6565 sb.style.width = ( iw - 30 ) + pixels;
6666 sq.style.width = ( iw - 110 ) + pixels;
6767 search.style.width = ( iw - 140 ) + pixels;
68 - results.style.width = ( sq.offsetWidth - 2 ) + pixels;
69 - results.style.left = sq.offsetLeft + pixels;
70 - results.style.top = ( sq.offsetTop + sq.offsetHeight ) + pixels;
 68+ if ( results ) {
 69+ results.style.width = ( sq.offsetWidth - 2 ) + pixels;
 70+ results.style.left = sq.offsetLeft + pixels;
 71+ results.style.top = ( sq.offsetTop + sq.offsetHeight ) + pixels;
 72+ }
7173 }
7274 }
7375

Follow-up revisions

RevisionCommit summaryAuthorDate
r1014291.18wmf1: MFT r101428preilly23:08, 31 October 2011

Status & tagging log