From 51c22804ca607797b73b92b5cb72578393ae4f5d Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Tue, 28 Aug 2012 00:51:27 +0100 Subject: [PATCH] Clicking on a port to restrict search now uses AJAX instead of page get --- Changes | 1 + Netdisco/views/ajax/device/ports.tt | 2 +- Netdisco/views/js/device.js | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index b985b6ba..379c9dbb 100644 --- a/Changes +++ b/Changes @@ -17,6 +17,7 @@ * Replace jquery-collapser with Bootstrap's collapser * Upgraded to Twitter Bootstrap 2.1.0 - customized for 13px font 18px line * Factor out inventory queries to the Device ResultSet (closes #20) + * Clicking on a port to restrict search now uses AJAX instead of page get [BUG FIXES] diff --git a/Netdisco/views/ajax/device/ports.tt b/Netdisco/views/ajax/device/ports.tt index e41a7ade..7f567358 100644 --- a/Netdisco/views/ajax/device/ports.tt +++ b/Netdisco/views/ajax/device/ports.tt @@ -23,7 +23,7 @@ [% END %] [% IF params.c_port %] - [% row.port | html_entity %] diff --git a/Netdisco/views/js/device.js b/Netdisco/views/js/device.js index 7dfdcc59..8a9a6875 100644 --- a/Netdisco/views/js/device.js +++ b/Netdisco/views/js/device.js @@ -53,11 +53,12 @@ }); // clickable device port names can simply resubmit AJAX rather than - // fetch the whole page again. FIXME unused? - $('.this_port_only').on('click', function() { + // fetch the whole page again. + $('body').on('click', '.nd_this_port_only', function() { event.preventDefault(); // link is real so prevent page submit var port = $(this).text(); + port = $.trim(port); sweep.val(port); $('.field_clear_icon').show();