Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #25 from Trott/drag-opens

check for defaultPrevented to disable clicks when a drag is happening
  • Loading branch information...
commit 4017626e56dd6cb54d8dd345bf0f70e861b3f745 2 parents d3e3ec1 + 1b819a1
@Trott authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 js/main.js
View
8 js/main.js
@@ -101,7 +101,10 @@ d3.json('data/' + id + '.json', function (error, links) {
.enter().append("circle")
.attr("r", 64)
.attr("class", "node")
- .on("click", function (datum,index) {
+ .on("click", function (datum, index) {
+ if (d3.event.defaultPrevented) {
+ return;
+ }
var transform = d3.transform(d3.select(this).attr("transform")).translate;
var width = 320;
var height = 320;
@@ -122,6 +125,9 @@ d3.json('data/' + id + '.json', function (error, links) {
.attr("dy", y + 32)
.text("")
.on("click", function () {
+ if (d3.event.defaultPrevented) {
+ return;
+ }
container.remove();
details.remove();
name.remove();
Please sign in to comment.
Something went wrong with that request. Please try again.