diff --git a/data/interfaces/default/history.html b/data/interfaces/default/history.html index a7a0dfcf..bb796574 100644 --- a/data/interfaces/default/history.html +++ b/data/interfaces/default/history.html @@ -66,6 +66,8 @@ 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() { if ($(this).hasClass('active')) { $('.delete-control').each(function() { diff --git a/data/interfaces/default/history_table_modal.html b/data/interfaces/default/history_table_modal.html index f0599592..cfff340d 100644 --- a/data/interfaces/default/history_table_modal.html +++ b/data/interfaces/default/history_table_modal.html @@ -43,6 +43,8 @@ } history_table = $('#history_table').DataTable(history_table_modal_options); + + clearSearchButton('history_table', history_table); }); % else: diff --git a/data/interfaces/default/info.html b/data/interfaces/default/info.html index 08455720..a1c313b2 100644 --- a/data/interfaces/default/info.html +++ b/data/interfaces/default/info.html @@ -267,6 +267,8 @@ DOCUMENTATION :: END 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); }); % elif data['type'] == 'show': @@ -285,6 +287,8 @@ 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); }); % endif @@ -303,7 +307,7 @@ DOCUMENTATION :: END % endif % endif diff --git a/data/interfaces/default/js/script.js b/data/interfaces/default/js/script.js index d4e2dbf8..0a4df6ff 100644 --- a/data/interfaces/default/js/script.js +++ b/data/interfaces/default/js/script.js @@ -348,3 +348,12 @@ Accordion.prototype.dropdown = function(e) { $el.find('.submenu').not($next).slideUp().parent().removeClass('open'); }; } + +function clearSearchButton(tableName, table) { + $('#' + tableName + '_filter').find('input[type=search]') + .wrap('
') + .after('') + $('#clear-search-' + tableName).click(function() { + table.search('').draw(); + }); +} diff --git a/data/interfaces/default/logs.html b/data/interfaces/default/logs.html index 51301fc2..bb992c17 100644 --- a/data/interfaces/default/logs.html +++ b/data/interfaces/default/logs.html @@ -86,8 +86,9 @@ from plexpy import helpers $(document).ready(function() { LoadPlexPyLogs(); + clearSearchButton('log_table', log_table); }); - + function LoadPlexPyLogs() { log_table_options.ajax = { "url": "getLog" @@ -105,11 +106,13 @@ from plexpy import helpers $("#plexpy-logs-btn").click(function() { $("#clear-logs").show(); LoadPlexPyLogs(); + clearSearchButton('log_table', log_table); }); $("#plex-logs-btn").click(function() { $("#clear-logs").hide(); LoadPlexLogs(); + clearSearchButton('plex_log_table', plex_log_table); }); $("#clear-logs").click(function() { diff --git a/data/interfaces/default/sync.html b/data/interfaces/default/sync.html index b856051c..7378ad77 100644 --- a/data/interfaces/default/sync.html +++ b/data/interfaces/default/sync.html @@ -57,9 +57,10 @@ "url": "get_sync" } sync_table = $('#sync_table').DataTable(sync_table_options); - var colvis = new $.fn.dataTable.ColVis( sync_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark' } ); $( colvis.button() ).appendTo('div.colvis-button-bar'); + + clearSearchButton('sync_table', sync_table); }); %def> diff --git a/data/interfaces/default/user.html b/data/interfaces/default/user.html index e8637750..366d46dc 100644 --- a/data/interfaces/default/user.html +++ b/data/interfaces/default/user.html @@ -314,6 +314,8 @@ from plexpy import helpers var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark', exclude: [0, 10] }); $(colvis.button()).appendTo('#button-bar-history'); + + clearSearchButton('history_table', history_table); }); $( "#ip-tab-btn" ).one( "click", function() { @@ -329,6 +331,8 @@ from plexpy import helpers } } user_ip_table = $('#user_ip_table').DataTable(user_ip_table_options); + + clearSearchButton('user_ip_table', user_ip_table); }); $( "#sync-tab-btn" ).one( "click", function() { @@ -341,10 +345,12 @@ from plexpy import helpers } } sync_table = $('#sync_table').DataTable(sync_table_options); - history_table.column(1).visible(false); + sync_table.column(1).visible(false); var colvis_sync = new $.fn.dataTable.ColVis( sync_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark' } ); $( colvis_sync.button() ).appendTo('#button-bar-sync'); + + clearSearchButton('sync_table', sync_table); }); // Load edit user modal diff --git a/data/interfaces/default/users.html b/data/interfaces/default/users.html index c3a3b01a..ddb52843 100644 --- a/data/interfaces/default/users.html +++ b/data/interfaces/default/users.html @@ -41,15 +41,20 @@