diff options
| author | Alon Levy <alon@pobox.com> | 2014-11-11 16:51:34 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-11-11 19:48:25 +0200 |
| commit | 5331427d3afc42c69ca1e2d859388069259726c2 (patch) | |
| tree | 5b1813bee045226399a7a34d16dbb67b8ecc3f6d /scripts | |
| parent | fcbab7373eb42b9f2053a66babca1abd6dc61709 (diff) | |
rz_core: make edge name editing input appear at correct place wrt translation
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/rz_core.js | 14 |
1 files changed, 7 insertions, 7 deletions
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) |
