timelines-chart
timelines-chart copied to clipboard
On-Click for entry?
I've been able to use the onLabelClick callback function just fine, but I have a need to drill down into the entries themselves to see more detailed information.
Is it possible to have an onClick function for the time entries themselves? Right now a tooltip comes up when you hover over them, so I would assume that an onClick behavior would be simple to add, but I'm unsure.
See https://github.com/vasturiano/timelines-chart/pull/29
This works to get the clicked segment. But is there a way to access the event? I want to use the event to find the DOM element to toggle a highlight of it when clicked.
I used
var e = event || window.event;
if(e){
var target = e.target || e.srcElement;
target.classList.toggle("clicked-gantt-item");
}
which works perfectly fine in both Chrome and Edge. However, Firefox does not allow access to the global event variable.
Normally the event itself is put as one of the arguments in the callback. But as far as I can tell not here.