Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion d3-tip.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ d3.tip = function() {
scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft

nodel.html(content)
.attr("keep_visible", "false")
.style('position', 'absolute')
.style('opacity', 1)
.style('pointer-events', 'all')
Expand All @@ -62,12 +63,21 @@ d3.tip = function() {
// Returns a tip
tip.hide = function() {
var nodel = getNodeEl()
nodel
if (nodel.attr("keep_visible") != "true") nodel
.style('opacity', 0)
.style('pointer-events', 'none')
return tip
}

// Public - toggle foring or not the tip to remain visible
//
// Returns a tip
tip.toggle_keep_visible = function() {
var nodel = getNodeEl()
nodel.attr("keep_visible", nodel.attr("keep_visible") == "false")
return tip
}

// Public: Proxy attr calls to the d3 tip container. Sets or gets attribute value.
//
// n - name of the attribute
Expand Down