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

13 lines
420 B
CoffeeScript
Raw Normal View History

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