Commit 5c1bba526723777c0a1cb767cce4e18e0bf2d55d
1 parent
e35c11e2
Exists in
master
and in
11 other branches
Style of auto-complete search field
Showing
3 changed files
with
35 additions
and
4 deletions
Show diff stats
index.html
| ... | ... | @@ -55,7 +55,9 @@ |
| 55 | 55 | |
| 56 | 56 | <div id="proposal-group" class='hide'> |
| 57 | 57 | <label for="search">Selecione um programa para fazer propostas e contar sua experiência. </label> |
| 58 | - <input placeholder="palavra chave" id="search-input" type="text" /> | |
| 58 | + <div id="search-input-container"> | |
| 59 | + <input placeholder="palavra chave" id="search-input" type="text" /> | |
| 60 | + </div> | |
| 59 | 61 | <ul> |
| 60 | 62 | {{#list_proposal article.children}} |
| 61 | 63 | {{#link title id}}{{/link}} | ... | ... |
js/main.js
| ... | ... | @@ -102,7 +102,8 @@ $.getJSON(noosferoAPI) |
| 102 | 102 | }); |
| 103 | 103 | $( "#search-input" ).autocomplete({ |
| 104 | 104 | source: availableTags, |
| 105 | - select: function( event, ui ) { display_proposal(ui.item['value' ].replace('#','')); } | |
| 105 | + select: function( event, ui ) { display_proposal(ui.item['value' ].replace('#','')); }, | |
| 106 | + appendTo: '#search-input-container' | |
| 106 | 107 | }); |
| 107 | 108 | |
| 108 | 109 | ... | ... |
sass/_proposal_group.scss
| ... | ... | @@ -5,15 +5,43 @@ |
| 5 | 5 | #search-input { |
| 6 | 6 | border: 1px solid #000; |
| 7 | 7 | padding: 1px; |
| 8 | - width: 49%; | |
| 8 | + width: 100%; | |
| 9 | 9 | font-size: 14px; |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | - label[for=search] { | |
| 12 | + #search-input-container, label[for=search] { | |
| 13 | 13 | width: 49%; |
| 14 | 14 | display: inline-block; |
| 15 | + height: 80px; | |
| 16 | + vertical-align: middle; | |
| 17 | + overflow: hidden; | |
| 18 | + } | |
| 19 | + | |
| 20 | + label[for=search] { | |
| 15 | 21 | text-align: right; |
| 16 | 22 | font-size: 14px; |
| 17 | 23 | max-width: 450px; |
| 18 | 24 | } |
| 19 | 25 | } |
| 26 | + | |
| 27 | +.ui-autocomplete { | |
| 28 | + display: block; | |
| 29 | + padding: 0; | |
| 30 | + border: 1px solid #000; | |
| 31 | + background: #fff; | |
| 32 | + width: 99%; | |
| 33 | + overflow: auto; | |
| 34 | + height: 50px; | |
| 35 | + | |
| 36 | + li { | |
| 37 | + list-style: none; | |
| 38 | + font-size: 14px; | |
| 39 | + cursor: pointer; | |
| 40 | + padding: 2px; | |
| 41 | + display: block !important; | |
| 42 | + float: none; | |
| 43 | + &:hover { | |
| 44 | + background: #eee; | |
| 45 | + } | |
| 46 | + } | |
| 47 | +} | ... | ... |