From aea3df8df6afaf1ba869306a41e2c8c5fc595981 Mon Sep 17 00:00:00 2001 From: rhenium Date: Mon, 14 Jul 2014 05:15:38 +0900 Subject: web: improve user jump form --- app/assets/javascripts/application.js.erb | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'app/assets/javascripts/application.js.erb') diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index ee046a4..9481858 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -6,34 +6,6 @@ //= require _define_application //= require_tree . -$(function() { - // Layout: User jump - $("#jump_to_dropdown_toggle").click(function() { - setTimeout(function() { $("#jump_to_textbox").focus(); }, 0); - }); - - var previous_jump_to_text; - $("#jump_to_textbox").on("keyup", function() { - 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) { - $("#jump_to_user").append($("
  • ").addClass("jump_to_user_suggestion") - .append($("").attr("href", "/" + s.screen_name).attr("title", s.name + " (@" + s.screen_name + ")") - .append($("").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($("").text("@" + s.screen_name)))); - }); - }); - } - } - }); - $("#jump_to_form").on("submit", function() { - $(this).attr("action", "/" + $("#jump_to_textbox").val()); - }); -}); - $(function() { var controller = $("body").data("controller"); var action = $("body").data("action"); -- cgit v1.2.3