open recordings in new tab and hide from viewers when unpublished

This commit is contained in:
Zachary Chai
2016-11-18 17:05:44 -05:00
parent 6620df9c65
commit 25bccb7699
3 changed files with 30 additions and 12 deletions

View File

@ -7,17 +7,20 @@
},
{
received: function(data) {
var table = $("#recordings").DataTable();
var recordings = Recordings.getInstance();
var table = recordings.table.api()
var row = table.row("#"+data.record_id);
if (data.action === 'update') {
var rowData = row.data();
rowData.published = data.published
table.row("#"+data.record_id).data(rowData).draw();
table.row("#"+data.record_id).data(rowData);
recordings.draw();
var published = (data.published) ? 'published' : 'unpublished';
showAlert(I18n['recording_'+published], 4000);
} else if (data.action === 'delete') {
row.remove().draw();
row.remove();
recordings.draw();
showAlert(I18n.recording_deleted, 4000);
}