20 lines
465 B
CoffeeScript
20 lines
465 B
CoffeeScript
$ ->
|
|
console.log('ready.')
|
|
|
|
$('#report-benchmarks').on('change', ->
|
|
url = '/api/benchmark/' + $('#report-benchmarks').val() + '/tests'
|
|
$.get(url, (data) ->
|
|
# clear old contents from the selector
|
|
$('#report-tests').empty()
|
|
# add new elements to the selector
|
|
addOption(test) for test in data
|
|
)
|
|
)
|
|
|
|
addOption = (test) ->
|
|
$('#report-tests').append(
|
|
$('<option/>')
|
|
.attr('value', test.id)
|
|
.text(test.title)
|
|
)
|