From c2994bdc4fbe424a87e861570996be678daa3173 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Wed, 22 Feb 2012 20:18:52 +0000 Subject: [PATCH] make port name clickable to restrict results only to that port --- Netdisco/views/ajax/device/ports.tt | 4 +--- Netdisco/views/js/device.js | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Netdisco/views/ajax/device/ports.tt b/Netdisco/views/ajax/device/ports.tt index de91f54d..9ad71ebe 100644 --- a/Netdisco/views/ajax/device/ports.tt +++ b/Netdisco/views/ajax/device/ports.tt @@ -23,9 +23,7 @@ [% END %] [% IF params.c_port %] - - [% row.port | html_entity %] - + [% row.port | html_entity %] [% END %] [% IF params.c_descr %] [% row.descr | html_entity %] diff --git a/Netdisco/views/js/device.js b/Netdisco/views/js/device.js index 0f725d8f..19b1a7a2 100644 --- a/Netdisco/views/js/device.js +++ b/Netdisco/views/js/device.js @@ -70,6 +70,14 @@ $('#ports_form').trigger('submit'); }); + // make all port names clickable to restrict results to that port only + $('body').delegate('.this_port_only', 'click', function() { + var port = $(this).text(); + sweep.val(port); + $('.field_clear_icon').show(); + $('#ports_form').trigger('submit'); + }); + // everything starts hidden and then we show defaults $('#nd_collapse_legend').click(); });