Add ability to delete synced items

This commit is contained in:
JonnyWong16 2017-11-11 19:41:51 -08:00
commit a2eeda64df
10 changed files with 227 additions and 48 deletions

View file

@ -45,6 +45,9 @@
<input type="radio" name="media_type-filter" id="history-music" value="track" autocomplete="off"> Music
</label>
</div>
<div class="btn-group">
<button class="btn btn-dark refresh-history-button" id="refresh-history-list"><i class="fa fa-refresh"></i> Refresh history</button>
</div>
<div class="btn-group colvis-button-bar"></div>
</div>
</div>
@ -169,17 +172,18 @@
$('#deleteCount').text(history_to_delete.length);
$('#confirm-modal-delete').modal();
$('#confirm-modal-delete').one('click', '#confirm-delete', function () {
for (var i = 0; i < history_to_delete.length; i++) {
history_to_delete.forEach(function(row, idx) {
$.ajax({
url: 'delete_history_rows',
data: { row_id: history_to_delete[i] },
type: 'POST',
data: { row_id: row },
async: true,
success: function (data) {
var msg = "History deleted";
showMsg(msg, false, true, 2000);
}
});
}
});
history_table.draw();
});
}
@ -199,5 +203,9 @@
});
% endif
});
$("#refresh-history-list").click(function() {
history_table.draw();
});
</script>
</%def>