Fixin fucking suggest
This commit is contained in:
parent
63a567f7ce
commit
190e19a7f1
|
@ -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: ->
|
||||||
|
@ -43,23 +42,8 @@ class window.Search
|
||||||
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', ->
|
||||||
|
|
|
@ -20,6 +20,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#search-form {
|
||||||
|
height: 28px !important;
|
||||||
|
}
|
||||||
|
|
||||||
#artist-load-spinner {
|
#artist-load-spinner {
|
||||||
display: none;
|
display: none;
|
||||||
float: right;
|
float: right;
|
||||||
|
|
|
@ -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]
|
||||||
(
|
(
|
||||||
= artist[:type]
|
= artist[:type]
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue