beathaven/app/assets/javascripts/bindings/autocomplete.js.coffee

13 lines
426 B
CoffeeScript
Raw Normal View History

2012-09-01 21:55:01 +04:00
$ ->
$(".navbar-search input").focus ->
2012-09-10 20:45:17 +04:00
$(this).animate(width: 244)
2012-09-02 02:03:19 +04:00
$(".player").animate(width: 368)
2012-09-01 21:55:01 +04:00
$(".navbar-search input").blur ->
2012-09-10 20:45:17 +04:00
$(this).animate(width: 133)
$(".player").animate(width: 467)
2012-09-01 21:55:01 +04:00
window.desired = $(".navbar-search input").autocomplete
serviceUrl: "/api/search/complete.json"
2012-09-01 21:55:01 +04:00
onSelect: (selected) ->
Backbone.history.navigate("/search/"+selected.replace(/\s/g, "+"), true)