From 190e19a7f1e594ae5a61a6feb60c67b95321e456 Mon Sep 17 00:00:00 2001 From: magnolia-fan Date: Thu, 24 Nov 2011 02:52:43 +0400 Subject: [PATCH] Fixin fucking suggest --- app/assets/javascripts/search.coffee | 18 +----------------- app/assets/stylesheets/search.scss | 4 ++++ app/views/artist/_suggestions.html.haml | 2 +- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/app/assets/javascripts/search.coffee b/app/assets/javascripts/search.coffee index d9d8807..1420def 100644 --- a/app/assets/javascripts/search.coffee +++ b/app/assets/javascripts/search.coffee @@ -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 ' -
  • - ' +item.name+ ' - ' +(if item.desc? then '
    '+item.desc+'' else '')+ ' -
  • ' - $('.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', -> diff --git a/app/assets/stylesheets/search.scss b/app/assets/stylesheets/search.scss index f57a88b..46b5003 100644 --- a/app/assets/stylesheets/search.scss +++ b/app/assets/stylesheets/search.scss @@ -20,6 +20,10 @@ } } +#search-form { + height: 28px !important; +} + #artist-load-spinner { display: none; float: right; diff --git a/app/views/artist/_suggestions.html.haml b/app/views/artist/_suggestions.html.haml index 56c4095..5ba8c28 100644 --- a/app/views/artist/_suggestions.html.haml +++ b/app/views/artist/_suggestions.html.haml @@ -4,7 +4,7 @@ %ul.suggestions - @suggestions.each do |artist| %li - %a.data.artist= artist[:name] + %a.data.artist= artist[:sort_name]  ( = artist[:type] )