diff --git a/Netdisco/public/css/style.css b/Netdisco/public/css/style.css index 8bd0e22a..004ac7c2 100644 --- a/Netdisco/public/css/style.css +++ b/Netdisco/public/css/style.css @@ -195,3 +195,11 @@ h3.device_label { position: fixed !important; margin-top: 50px; } + +/* little sweep brush inside of port filter input field */ +.field_clear_icon { + position: absolute; + margin-left: 137px; + margin-top: 6px; + z-index: 1; +} diff --git a/Netdisco/public/images/sweep.png b/Netdisco/public/images/sweep.png new file mode 100644 index 00000000..e6c8e8b9 Binary files /dev/null and b/Netdisco/public/images/sweep.png differ diff --git a/Netdisco/views/js/device.js b/Netdisco/views/js/device.js index 35360362..2225b07e 100644 --- a/Netdisco/views/js/device.js +++ b/Netdisco/views/js/device.js @@ -79,19 +79,6 @@ ); } - // search hook for each tab - [% FOREACH tab IN vars.tabs %] - $('[% "#${tab.id}_form" %]').submit(function(event){ do_search(event, '[% tab.id %]'); }); - [% END %] - - // on page load, load the content for the active tab - [% IF params.tab %] - $('#[% params.tab %]_form').trigger("submit"); - [% END %] - - // everything starts hidden and then we show defaults - $('#nd_collapse_legend').click(); - // on tab change, hide previous tab's search form and show new tab's // search form. also trigger to load the content for the newly active tab. $('#search_results').bind('change', function(e) { @@ -117,5 +104,24 @@ }; $('.add-on :checkbox').each(syncCheckBox).click(syncCheckBox); + // handler for sweeping brush icon in port filter box + $('.field_clear_icon').click(function() { + $('#ports_form').find("input[name=q]").val(''); + $('#ports_form').trigger('submit'); + }); + + // search hook for each tab + [% FOREACH tab IN vars.tabs %] + $('[% "#${tab.id}_form" %]').submit(function(event){ do_search(event, '[% tab.id %]'); }); + [% END %] + + // on page load, load the content for the active tab + [% IF params.tab %] + $('#[% params.tab %]_form').trigger("submit"); + [% END %] + + // everything starts hidden and then we show defaults + $('#nd_collapse_legend').click(); + [%+ INCLUDE 'js/sidebar.js' -%] }); diff --git a/Netdisco/views/sidebar/device/ports.tt b/Netdisco/views/sidebar/device/ports.tt index 12612933..40950314 100644 --- a/Netdisco/views/sidebar/device/ports.tt +++ b/Netdisco/views/sidebar/device/ports.tt @@ -3,6 +3,9 @@
+ +