title: Changing HTML on click in D3.js disables doubleclick
body: <p>I've written a D3 method that changes the text in a  tag (a tooltip of sorts). This happens when I click a node in a force-directed graph. However, when I doubleclick I would like to hide certain nodes. Without the tooltip this works just fine, but when I include the code to change the tooltip, the doubleclick doesn't seem to work. Any help would be greatly appreciated.</p>
  
  <pre><code>function tooltip(d) {
    console.log("Clickvar: " + clickvar);
    if (clickvar == false) {
      div.transition()
        .duration(300)
        .style("opacity", .9);
      div.html("&lt;p&gt;Top-tag: \n" + d.tag + "&lt;/p&gt;&lt;p&gt;Contacts: "+ d.contacts + "&lt;/p&gt;")
        .style("left", d3.event.pageX + "px")
        .style("top", d3.event.pageY + "px");
      clickvar = true;
    }
    else {
      div.transition()
        .duration(100)
        .style("opacity", 0);
      clickvar = false;
    }
  }
  </code></pre>