1
0
Fork 0

Fixin fucking suggest

This commit is contained in:
magnolia-fan 2011-11-24 02:52:43 +04:00
parent 63a567f7ce
commit 190e19a7f1
3 changed files with 6 additions and 18 deletions

View File

@ -4,7 +4,6 @@ class window.Search
$('#search').attr(disabled: 'disabled').blur()
$('#autocomplete-container').hide()
$('#artist-load-spinner').show()
this.hideSuggestions()
false
hideSpinner: ->
@ -42,24 +41,9 @@ class window.Search
_search.hideSpinner()
alert "Not found"
false
showSuggestions: (values) ->
for item in values
$('.suggestions ul').append '
<li>
<a class="data artist">' +item.name+ '</a>
' +(if item.desc? then '<br/><span>'+item.desc+'</span>' else '')+ '
</li>'
$('.suggestions').show()
false
hideSuggestions: ->
$('.suggestions ul li').remove()
$('.suggestions').hide()
false
$('#search-form').live 'submit', ->
$('#autocomplete-container').remove()
$('#autocomplete-container').hide()
_search.loadArtistData $('#search').val()
false
$('.data.artist').live 'click', ->

View File

@ -20,6 +20,10 @@
}
}
#search-form {
height: 28px !important;
}
#artist-load-spinner {
display: none;
float: right;

View File

@ -4,7 +4,7 @@
%ul.suggestions
- @suggestions.each do |artist|
%li
%a.data.artist= artist[:name]
%a.data.artist= artist[:sort_name]
&nbsp;(
= artist[:type]
)