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() $('#search').attr(disabled: 'disabled').blur()
$('#autocomplete-container').hide() $('#autocomplete-container').hide()
$('#artist-load-spinner').show() $('#artist-load-spinner').show()
this.hideSuggestions()
false false
hideSpinner: -> hideSpinner: ->
@ -42,24 +41,9 @@ class window.Search
_search.hideSpinner() _search.hideSpinner()
alert "Not found" alert "Not found"
false 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', -> $('#search-form').live 'submit', ->
$('#autocomplete-container').remove() $('#autocomplete-container').hide()
_search.loadArtistData $('#search').val() _search.loadArtistData $('#search').val()
false false
$('.data.artist').live 'click', -> $('.data.artist').live 'click', ->

View File

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

View File

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