r113227 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113226‎ | r113227 | r113228 >
Date:13:55, 7 March 2012
Author:jdlrobson
Status:ok
Tags:
Comment:
correctly align search results in opensearch.js

padding was changed to search and broke alignment
added some notes to css to hopefully avoid future
problems
Modified paths:
  • /trunk/extensions/MobileFrontend/javascripts/opensearch.js (modified) (history)
  • /trunk/extensions/MobileFrontend/stylesheets/common.css (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/javascripts/opensearch.js
@@ -97,11 +97,11 @@
9898 header = document.getElementById( 'header' );
9999
100100 results.style.display = 'block';
101 - var top = sq.offsetParent.offsetTop + sq.offsetHeight + sq.offsetTop + 1 + header.offsetTop;
 101+ var top = sq.offsetParent.offsetTop + sq.offsetHeight + sq.offsetTop - 1 + header.offsetTop;
102102 results.style.top = top + 'px';
103103
104104 if ( !sections || sections.length < 1 ) {
105 - results.innerHTML = "No results";
 105+ results.innerHTML = '<div class="suggestions-results"><div class="suggestions-result">No results</div></div>';
106106 } else {
107107 if( results.firstChild ) {
108108 results.removeChild( results.firstChild );
Index: trunk/extensions/MobileFrontend/stylesheets/common.css
@@ -180,8 +180,8 @@
181181 border-bottom: 1px solid #888;
182182 z-index: 2;
183183 position: absolute;
184 - left: 53px;
185 - right: 41px;
 184+ left: 52px; /* #searchbox padding left 44px + margin-left */
 185+ right: 40px; /* #searchbox padding right 32px + header margin-right */
186186 }
187187
188188 html[dir="rtl"] #results {
@@ -219,6 +219,7 @@
220220 zoom: 1;
221221 vertical-align: middle;
222222 position: relative;
 223+ z-index: 2;
223224 }
224225
225226 #userloginForm table,
@@ -577,7 +578,7 @@
578579 #searchbox {
579580 width: auto;
580581 position: relative;
581 - padding: 7px 32px 7px 44px;
 582+ padding: 7px 32px 7px 44px; /* WARNING: check #results left and right */
582583 border: 1px solid #cccccc;
583584 -webkit-border-radius: 2px;
584585 -moz-border-radius: 2px;

Status & tagging log