Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Commits on Jul 20, 2014
@Trott check for defaultPrevented to disable clicks when a drag is happening 1b819a1
@Trott Merge pull request #25 from Trott/drag-opens
check for defaultPrevented to disable clicks when a drag is happening
4017626
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();

No commit comments for this range

Something went wrong with that request. Please try again.