diff --git a/data/interfaces/default/info.html b/data/interfaces/default/info.html index 9fe80327..cc8e6b0a 100644 --- a/data/interfaces/default/info.html +++ b/data/interfaces/default/info.html @@ -263,6 +263,24 @@ DOCUMENTATION :: END + % endif @@ -312,19 +330,43 @@ DOCUMENTATION :: END } } history_table = $('#history_table').DataTable(history_table_options); - var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark', exclude: [0, 10] }); $(colvis.button()).appendTo('div.colvis-button-bar'); clearSearchButton('history_table', history_table); - $('#row-edit-mode').click(function() { + $('#row-edit-mode').on('click', function() { + $('#row-edit-mode-alert').fadeIn(200); + if ($(this).hasClass('active')) { - $('.delete-control').each(function() { + if (history_to_delete.length > 0) { + $('#deleteCount').text(history_to_delete.length); + $('#confirm-modal').modal(); + $('#confirm-modal').one('click', '#confirm-delete', function () { + for (var i = 0; i < history_to_delete.length; i++) { + $.ajax({ + url: 'delete_history_rows', + data: { row_id: history_to_delete[i] }, + async: true, + success: function (data) { + var msg = "History deleted"; + showMsg(msg, false, true, 2000); + } + }); + } + history_table.draw(); + }); + } + + $('.delete-control').each(function () { $(this).addClass('hidden'); + $('#row-edit-mode-alert').fadeOut(200); }); + } else { + history_to_delete = []; $('.delete-control').each(function() { + $(this).find('button.btn-danger').toggleClass('btn-warning').toggleClass('btn-danger'); $(this).removeClass('hidden'); }); } @@ -386,6 +428,7 @@ DOCUMENTATION :: END } }); }); + $.ajax({ url: 'get_show_children', type: "GET",