openSUSE/osem

View on GitHub
app/views/admin/tracks/toggle_cfp_inclusion.js.erb

Summary

Maintainability
Test Coverage
$('.alert').remove();

track_id = <%= @track.id %>;
track_cfp_td = $('#cfp_switch_' + track_id);
track_cfp_value = <%= @track.cfp_active %>;

track_cfp_td.attr('data-order', track_cfp_value);

/*
* The updated data-order attribute isn't taken into account
* until we invalidate the cell
*/
$('#tracks').DataTable().cell(track_cfp_td).invalidate();