Index: trunk/extensions/MobileFrontend/javascripts/beta_application.js |
— | — | @@ -27,8 +27,9 @@ |
28 | 28 | } |
29 | 29 | |
30 | 30 | function handleDefaultText() { |
31 | | - if (search.value == placeholder) { |
32 | | - search.value = ''; |
| 31 | + var pE = document.getElementById( 'placeholder' ); |
| 32 | + if ( pE ) { |
| 33 | + pE.style.display = 'none'; |
33 | 34 | } |
34 | 35 | } |
35 | 36 | |
— | — | @@ -38,15 +39,6 @@ |
39 | 40 | clearSearch.style.display = 'block'; |
40 | 41 | } else { |
41 | 42 | clearSearch.style.display = 'none'; |
42 | | - // if ( results ) { |
43 | | - // results.style.display = 'none'; |
44 | | - // } |
45 | | - // if ( typeof removeResults == 'function' ) { |
46 | | - // removeResults(); |
47 | | - // if ( search ) { |
48 | | - // search.blur(); |
49 | | - // } |
50 | | - // } |
51 | 43 | } |
52 | 44 | } |
53 | 45 | } |
Index: trunk/extensions/MobileFrontend/javascripts/beta_opensearch.js |
— | — | @@ -32,7 +32,6 @@ |
33 | 33 | ol.sqLeft = sq.offsetLeft; |
34 | 34 | ol.sqTop = sq.offsetTop; |
35 | 35 | sq.style.position = 'absolute'; |
36 | | - search.value = placeholder; |
37 | 36 | |
38 | 37 | if ( !ol.properOffsetWidth ) { |
39 | 38 | ol.properOffsetWidth = search.offsetLeft + 44; |
— | — | @@ -63,6 +62,26 @@ |
64 | 63 | sb.style.border = 0 + pixels; |
65 | 64 | logo.style.visibility = 'hidden'; |
66 | 65 | goButton.style.visibility = 'hidden'; |
| 66 | + |
| 67 | + var pE = document.getElementById( 'placeholder' ); |
| 68 | + if ( !pE ) { |
| 69 | + pT = document.createElement( 'span' ); |
| 70 | + var pTT = document.createTextNode(placeholder); |
| 71 | + pT.setAttribute( 'id', 'placeholder' ); |
| 72 | + pT.appendChild(pTT); |
| 73 | + sb.insertBefore( pT, sb.firstChild ); |
| 74 | + } |
| 75 | + var pE = document.getElementById( 'placeholder' ); |
| 76 | + if ( pE ) { |
| 77 | + pE.style.position = 'absolute'; |
| 78 | + pE.style.left = ( search.offsetLeft + 5 ) + pixels; |
| 79 | + pE.style.top = ( sq.offsetTop + 12 ) + pixels; |
| 80 | + //pE.style.zIndex = -1; |
| 81 | + pE.style.color = '#666666'; |
| 82 | + pE.style.fontSize = 16 + pixels; |
| 83 | + pE.style.display = 'block'; |
| 84 | + search.style.backgroundColor = 'transparent'; |
| 85 | + } |
67 | 86 | var removeResults = document.getElementById( 'remove-results' ); |
68 | 87 | if ( !removeResults ) { |
69 | 88 | rrd = document.createElement( 'a' ); |
— | — | @@ -151,7 +170,6 @@ |
152 | 171 | |
153 | 172 | e.cancelBubble = true; |
154 | 173 | e.stopPropagation(); |
155 | | - |
156 | 174 | if ( targ.className == "suggestion-result" || |
157 | 175 | targ.className == "search-result-item" || |
158 | 176 | targ.className == "suggestions-result" || |
— | — | @@ -160,6 +178,7 @@ |
161 | 179 | targ.id == 'search' || |
162 | 180 | targ.id == 'searchbox' || |
163 | 181 | targ.id == 'sq' || |
| 182 | + targ.id == 'placeholder' || |
164 | 183 | targ.id == 'clearsearch' || |
165 | 184 | targ.tagName == 'BODY' ) { |
166 | 185 | if ( targ.id == 'clearsearch' && results ) { |