colossus/assets/scripts/bedabin.coffee

20 lines
465 B
CoffeeScript
Raw Normal View History

2024-06-03 12:44:13 -04:00
$ ->
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)
)