diff --git a/app/static/js/csentry.js b/app/static/js/csentry.js index b978aa4eba9a2c36fc9d76e818e0a721efb6a069..cbb0d7a61b7ad005465b51b1736419bc08cf2070 100644 --- a/app/static/js/csentry.js +++ b/app/static/js/csentry.js @@ -104,6 +104,20 @@ function update_stack_member() { ); } +// Function to initialize tooltip on DataTables search box +// Only used when using server side processing +function configure_search_tooltip() { + $(".dataTables_filter").tooltip({ + title: + "Enter keyword(s) or use wildcard character '*' for partial match. See the help for more information.", + }); + + // Hide the tooltip when clicking in the search box + $("input[type='search'").focus(function () { + $(".dataTables_filter").tooltip("hide"); + }); +} + $(document).ready(function () { // When an invalid input was submitted, the server // adds the "is-invalid" class to form fields to display diff --git a/app/static/js/groups.js b/app/static/js/groups.js index 20262b95685edfc5ad55eb4ae691628d9fe04227..1378d3b03a7a0482e33b6cb72aaf5ef5305fcaa9 100644 --- a/app/static/js/groups.js +++ b/app/static/js/groups.js @@ -114,5 +114,7 @@ $(document).ready(function () { .buttons() .container() .appendTo("#groups_table_wrapper .col-md-3:eq(0)"); + + configure_search_tooltip(); } }); diff --git a/app/static/js/hosts.js b/app/static/js/hosts.js index dcfa056553f269c86092101455d488f58c713479..031a20796008b9117b483b0b93ddc69988106cdb 100644 --- a/app/static/js/hosts.js +++ b/app/static/js/hosts.js @@ -196,5 +196,7 @@ $(document).ready(function () { .buttons() .container() .appendTo("#hosts_table_wrapper .col-md-3:eq(0)"); + + configure_search_tooltip(); } }); diff --git a/app/static/js/items.js b/app/static/js/items.js index 2ddbb68198a9ad511bec408f473e2b8bd21483bb..016b683bc7567a3b158bc3a8abe5dc324838c00f 100644 --- a/app/static/js/items.js +++ b/app/static/js/items.js @@ -144,4 +144,6 @@ $(document).ready(function () { .container() .appendTo("#items_table_wrapper .col-md-3:eq(0)"); } + + configure_search_tooltip(); });