From 5331427d3afc42c69ca1e2d859388069259726c2 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Tue, 11 Nov 2014 16:51:34 +0200 Subject: rz_core: make edge name editing input appear at correct place wrt translation --- scripts/rz_core.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/rz_core.js b/scripts/rz_core.js index 1f9fd003..eb3cc341 100644 --- a/scripts/rz_core.js +++ b/scripts/rz_core.js @@ -171,7 +171,7 @@ function update(no_relayout) { .attr("text-anchor", "middle") .on("click", function(d, i) { if (d.state !== "temp") { - editLink(d, i); + editLink(this, d, i); } }); @@ -590,12 +590,12 @@ function editNode(node, d, i) { element.data().d = d; } -function editLink(d, i) { - var dx = (d.source.x + d.target.x) / 2; - var dy = (d.source.y + d.target.y) / 2; - var oldname = d.name; - $('.editlinkinfo').css('top', dy - 17); - $('.editlinkinfo').css('left', dx - 18); +function editLink(link, d, i) { + var offset = $(link).offset(), + oldname = d.name; + + $('.editlinkinfo').css('top', offset.top); + $('.editlinkinfo').css('left', offset.left); $('#editlinkname').val(oldname); // TODO: handle escape as well to quit without changes (enter does submit) -- cgit v1.3.1