From 8b353e3e7691be1dd4adc01689b05aa56acf045d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Wed, 4 Oct 2017 17:09:00 +0200 Subject: [PATCH] Properly use click event --- lookyloo/static/tree.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lookyloo/static/tree.js b/lookyloo/static/tree.js index 3454a5b8..e9e731b0 100644 --- a/lookyloo/static/tree.js +++ b/lookyloo/static/tree.js @@ -80,8 +80,8 @@ function getBB(selection) { }) } -function urlnode_click(uuid) { - var url = "url/" + uuid; +function urlnode_click(data) { + var url = "url/" + data['uuid']; d3.json(url, function(error, u) { if (error) throw error; console.log(u) @@ -105,12 +105,12 @@ function hostnode_click(d) { var list = hostnode_tooltip.append('ul') .attr("class", "list-group"); urls.forEach(function(url){ - jdata = JSON.parse(url) + var jdata = JSON.parse(url) var entry = list.append('li') .attr("class", "list-group-item") .attr("url_uuid", jdata['uuid']) .text(jdata['name']) - .on('click', urlnode_click(jdata['uuid'])); + .on('click', function(){urlnode_click(jdata)}); }) }); }