Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/javascripts/application.js |
— | — | @@ -1,32 +1,3 @@ |
2 | | -var search = document.getElementById( 'search' ); |
3 | | -var clearSearch = document.getElementById( 'clearsearch' ); |
4 | | - |
5 | | -initClearSearchLink(); |
6 | | - |
7 | | -function initClearSearchLink() { |
8 | | - clearSearch.setAttribute( 'title','Clear' ); |
9 | | - clearSearch.addEventListener( 'mousedown', clearSearchBox, true ); |
10 | | - search.addEventListener( 'keyup', _handleClearSearchLink, false ); |
11 | | -} |
12 | | - |
13 | | -function _handleClearSearchLink() { |
14 | | - if ( clearSearch ) { |
15 | | - if ( search.value.length > 0 ) { |
16 | | - clearSearch.style.display = 'block'; |
17 | | - } else { |
18 | | - clearSearch.style.display = 'none'; |
19 | | - } |
20 | | - } |
21 | | -} |
22 | | - |
23 | | -function clearSearchBox( event ) { |
24 | | - search.value = ''; |
25 | | - clearSearch.style.display = 'none'; |
26 | | - if ( event ) { |
27 | | - event.preventDefault(); |
28 | | - } |
29 | | -} |
30 | | - |
31 | 2 | // I don't think this makes sense. Loading this here means that this button |
32 | 3 | // won't function until the page is loaded. It would probably be an |
33 | 4 | // improvement to just attach an onclick straight into the html. |
— | — | @@ -112,4 +83,4 @@ |
113 | 84 | var s = document.getElementById( d[i] + section_id ).style; |
114 | 85 | s.display = s.display == 'block' ? 'none' : 'block'; |
115 | 86 | } |
116 | | -} |
\ No newline at end of file |
| 87 | +} |