Added click and mousedown event
Added minified JS file
This commit is contained in:
parent
59a2fec639
commit
0adf438a62
@ -264,8 +264,23 @@ class BBTimeline {
|
||||
|
||||
if (a.Debug) console.log(event);
|
||||
|
||||
a.OnEventClick(this, e, event);
|
||||
a.OnMouseDown(this, e, event);
|
||||
});
|
||||
|
||||
a.ctx.canvas.addEventListener('click', function (e) {
|
||||
if (!a.Enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
var event = a.FindEventsByCoords(e.offsetX, e.offsetY);
|
||||
if (event == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (a.Debug) console.log(event);
|
||||
|
||||
a.OnClick(this, e, event);
|
||||
});
|
||||
}
|
||||
|
||||
Invalidate(redrawAxis, redrawMarkers) {
|
||||
@ -381,7 +396,10 @@ class BBTimeline {
|
||||
return result;
|
||||
}
|
||||
|
||||
OnEventClick(sender, e, event) {
|
||||
OnMouseDown(sender, e, event) {
|
||||
}
|
||||
|
||||
OnClick(sender, e, event) {
|
||||
}
|
||||
|
||||
|
||||
|
5
bbtimeline.min.js
vendored
Normal file
5
bbtimeline.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -124,8 +124,21 @@ textarea {
|
||||
<script>
|
||||
|
||||
var timeline1 = new BBTimeline("myCanvas");
|
||||
timeline1.OnEventClick = function(sender, e, event) {
|
||||
// console.log(e);
|
||||
timeline1.OnMouseDown = function(sender, e, event) {
|
||||
LogInfo("");
|
||||
LogInfo("OnMouseDown");
|
||||
LogInfo(JSON.stringify(sender));
|
||||
LogInfo(JSON.stringify(e));
|
||||
LogInfo(JSON.stringify(event));
|
||||
LogInfo("");
|
||||
}
|
||||
timeline1.OnClick = function(sender, e, event) {
|
||||
LogInfo("");
|
||||
LogInfo("OnClick");
|
||||
LogInfo(JSON.stringify(sender));
|
||||
LogInfo(JSON.stringify(e));
|
||||
LogInfo(JSON.stringify(event));
|
||||
LogInfo("");
|
||||
}
|
||||
|
||||
SetToday();
|
||||
|
Loading…
Reference in New Issue
Block a user