Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Coffee Search
$- >
initializeLinkSearch()
initializeLinkSearch = ->
$("#search").keyup ->
resetLinks()
displayLinksMatching searchTerm()
resetLinks = ->
links = $('.links li a')
links.hide()
displayLinksMatching = (searchTerm) ->
$(".links li a:contains('#{searchTerm}')").show()
$(".links li a.#{searchTerm}").show()
$(".links li a").show() if searchTerm is ''
searchTerm = ->
$('#search').val()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.