diff options
author | Rhenium <rhenium@rhe.jp> | 2014-03-10 19:10:20 +0900 |
---|---|---|
committer | Rhenium <rhenium@rhe.jp> | 2014-03-10 19:10:20 +0900 |
commit | 7f35e6c11be4555523e7155dd44ba546365958bf (patch) | |
tree | 9e5c64b1628204c7d9e71fa6c8bc702787368809 /app/assets/javascripts/application.js.erb | |
parent | 1647b05cb2e8604d716dec4072c20ce9de3bfbaa (diff) | |
download | aclog-7f35e6c11be4555523e7155dd44ba546365958bf.tar.gz |
show alternative image also in jump_to_user suggestions (when error)
Diffstat (limited to 'app/assets/javascripts/application.js.erb')
-rw-r--r-- | app/assets/javascripts/application.js.erb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index d5ca16b..a6b0994 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -10,18 +10,18 @@ $(function() { $("#jump_to_dropdown_toggle").click(function() { setTimeout(function() { $("#jump_to_textbox").focus(); }, 0); }); + var previous_jump_to_text; $("#jump_to_textbox").on("keyup", function() { - var p = $("#jump_to_user"); if ($(this).val() != previous_jump_to_text) { previous_jump_to_text = $(this).val(); $("#jump_to_user .jump_to_user_suggestion").remove(); if ($(this).val().length > 0) { $.getJSON("/i/user_jump_suggest.json", { head: $(this).val() }, function(json) { json.forEach(function(s) { - p.append($("<li />").addClass("jump_to_user_suggestion") + $("#jump_to_user").append($("<li />").addClass("jump_to_user_suggestion") .append($("<a />").attr("href", "/" + s.screen_name).attr("title", s.name + " (@" + s.screen_name + ")") - .append($("<img />").addClass("twitter-icon").attr("src", s.profile_image_url).attr("alt", "@" + s.screen_name)) + .append($("<img />").addClass("twitter-icon").attr("src", s.profile_image_url).attr("alt", "@" + s.screen_name).attr("onerror", "this.src = '<%= image_path("profile_image_missing.png") %>'")) .append($("<span />").text("@" + s.screen_name)))); }); }); |