Files
puppetboard/puppetboard/static/coffeescript/tables.coffee
Daniele Sluijters f41dd99f60 puppetboard: Commit the current code.
This is all the code after a week and a bit hacking on this project.
It's in a rather experimental state but should work with a little
effort.
2013-08-07 09:05:31 +02:00

29 lines
568 B
CoffeeScript

$ = jQuery
$ ->
$('.nodes').tablesorter(
headers:
3:
sorter: false
sortList: [[0,0]]
)
$('.facts').tablesorter(
sortList: [[0,0]]
)
$('input.filter-table').parent('div').removeClass('hide')
$("input.filter-table").on "keyup", (e) ->
rex = new RegExp($(this).val(), "i")
$(".searchable tr").hide()
$(".searchable tr").filter( ->
rex.test $(this).text()
).show()
if e.keyCode is 27
$(e.currentTarget).val ""
ev = $.Event("keyup")
ev.keyCode = 13
$(e.currentTarget).trigger(ev)
e.currentTarget.blur()