Browse Source

Use 'display' property to control tooltip visibility

pull/8/head
mikhail samoilov 11 years ago
parent
commit
ad36ed3dab
  1. 10
      c3.js

10
c3.js

@ -978,7 +978,7 @@
.style("position", "absolute") .style("position", "absolute")
.style("width", "30%") // TODO: cul actual width when show .style("width", "30%") // TODO: cul actual width when show
.style("z-index", "10") .style("z-index", "10")
.style("visibility", "hidden"); .style("display", "none");
/*-- Main Region --*/ /*-- Main Region --*/
@ -1123,7 +1123,7 @@
}) })
.on('mouseout', function (d, i) { .on('mouseout', function (d, i) {
main.select('line.xgrid-focus').style("visibility", "hidden"); main.select('line.xgrid-focus').style("visibility", "hidden");
tooltip.style("visibility", "hidden"); tooltip.style("display", "none");
// Undo expanded circles // Undo expanded circles
main.selectAll('.-circle-' + i) main.selectAll('.-circle-' + i)
.filter(function () { return d3.select(this).classed(EXPANDED); }) .filter(function () { return d3.select(this).classed(EXPANDED); })
@ -1142,7 +1142,7 @@
tooltip.style("top", (d3.mouse(this)[1] + 15) + "px") tooltip.style("top", (d3.mouse(this)[1] + 15) + "px")
.style("left", ((__axis_rotated ? d3.mouse(this)[0] : x(selectedData[0].x)) + 60) + "px"); .style("left", ((__axis_rotated ? d3.mouse(this)[0] : x(selectedData[0].x)) + 60) + "px");
tooltip.html(__tooltip_contents(selectedData)); tooltip.html(__tooltip_contents(selectedData));
tooltip.style("visibility", "visible"); tooltip.style("display", "block");
if (! __data_selection_enabled || dragging) { return; } if (! __data_selection_enabled || dragging) { return; }
if (__data_selection_grouped) { return; } // nothing to do when grouped if (__data_selection_grouped) { return; } // nothing to do when grouped
@ -1347,7 +1347,7 @@
}))); })));
tooltip.style("top", __tooltip_init_position.top) tooltip.style("top", __tooltip_init_position.top)
.style("left", __tooltip_init_position.left) .style("left", __tooltip_init_position.left)
.style("visibility", "visible"); .style("display", "block");
} }
} }
@ -1388,7 +1388,7 @@
subY2.domain(y2.domain()); subY2.domain(y2.domain());
// tooltip // tooltip
tooltip.style("visibility", "hidden"); tooltip.style("display", "none");
// grid // grid
main.select('line.xgrid-focus') main.select('line.xgrid-focus')

Loading…
Cancel
Save