r104938 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104937‎ | r104938 | r104939 >
Date:02:03, 2 December 2011
Author:preilly
Status:ok
Tags:
Comment:
fix full-screen search on orientation change
Modified paths:
  • /trunk/extensions/MobileFrontend/javascripts/beta_opensearch.js (modified) (history)
  • /trunk/extensions/MobileFrontend/stylesheets/beta_common.css (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/javascripts/beta_opensearch.js
@@ -27,23 +27,27 @@
2828 var ol = new Object();
2929 search.onfocus = function() {
3030 if ( !focused ) {
 31+ content.style.display = 'none';
 32+ footer.style.display = 'none';
3133 ol.sqLeft = sq.offsetLeft;
3234 ol.sqTop = sq.offsetTop;
3335 sq.style.position = 'absolute';
3436
 37+ if ( !ol.properOffsetWidth ) {
 38+ ol.properOffsetWidth = search.offsetLeft + 44;
 39+ }
 40+
 41+ sq.className = '';
3542 sq.style.left = sb.offsetLeft + pixels;
3643 sq.style.top = sb.offsetTop + pixels;
3744 sq.style.height = sb.offsetHeight + pixels;
3845 sq.style.width = sb.offsetWidth + pixels;
39 -
40 - sq.className = 'animate';
41 -
4246 sq.style.left = 0 + pixels;
4347 sq.style.top = 0 + pixels;
4448 sq.style.height = 40 + pixels;
4549 sq.style.width = document.body.clientWidth + pixels;
4650 search.style.position = 'absolute';
47 - search.style.left = ( search.offsetLeft + 44 ) + pixels;
 51+ search.style.left = ol.properOffsetWidth + pixels;
4852 search.style.height = 34 + pixels;
4953 search.style.width = ( document.body.clientWidth - 90 ) + pixels;
5054 search.style.fontSize = 16 + pixels;
@@ -51,8 +55,6 @@
5256 results.style.top = ( sq.offsetTop + sq.offsetHeight ) + pixels;
5357 results.style.width = document.body.clientWidth + pixels;
5458 results.style.minHeight = '100%';
55 - content.style.display = 'none';
56 - footer.style.display = 'none';
5759 results.style.borderTop = 'solid 1px #A6A6A6';
5860 results.style.backgroundColor = '#E6E6E6';
5961 results.style.paddingTop = 5 + pixels;
@@ -88,8 +90,6 @@
8991 if ( sq ) {
9092 logo.style.visibility = 'visible';
9193 goButton.style.visibility = 'visible';
92 - //var reg = new RegExp('(\\s|^)animate(\\s|$)');
93 - //sq.className = sq.className.replace(reg, '');
9494 sq.className = 'divclearable';
9595 sq.style.position = 'static';
9696 sq.style.left = ol.sqLeft + pixels;
@@ -175,6 +175,11 @@
176176 results.style.width = ( sq.offsetWidth - 2 ) + pixels;
177177 results.style.left = sq.offsetLeft + pixels;
178178 results.style.top = ( sq.offsetTop + sq.offsetHeight ) + pixels;
 179+ if ( results.style.display == 'block' ) {
 180+ focused = false;
 181+ search.blur();
 182+ search.focus();
 183+ }
179184 }
180185 }
181186 }
@@ -187,7 +192,7 @@
188193 case -90:
189194 case 90:
190195 case 180:
191 - setTimeout( "updateSearchWidth()", 200 );
 196+ setTimeout( "updateSearchWidth()", 300 );
192197 break;
193198 }
194199 }
Index: trunk/extensions/MobileFrontend/stylesheets/beta_common.css
@@ -98,9 +98,6 @@
9999 display: none;
100100 background-color: #ffffff;
101101 border-top: none;
102 - border-left: 1px solid #888;
103 - border-right: 1px solid #888;
104 - border-bottom: 1px solid #888;
105102 z-index: 2;
106103 position: absolute;
107104 }
@@ -150,19 +147,6 @@
151148 border: 0px solid;
152149 }
153150
154 -#sq {
155 -/* background-color: #ff0000;*/
156 -}
157 -
158 -#sq.animate {
159 - -webkit-transition: all .3s ease-in 100ms;
160 -/* background-color: #0000ff;*/
161 -}
162 -
163 -#searchbox {
164 -/* background-color: #00ff00;*/
165 -}
166 -
167151 .divclearable {
168152 border: 1px solid #888;
169153 display: -moz-inline-stack;

Follow-up revisions

RevisionCommit summaryAuthorDate
r1049391.18wmf1: MFT r104938preilly02:04, 2 December 2011

Status & tagging log