This repository was archived by the owner on Jul 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add and fix mouse events on timeline #2473
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
dcb2d58
Fix redraw order
yotamberk 582fc64
Merge branch 'develop' of https://github.com/almende/vis into develop
yotamberk f96e6bf
Merge branch 'develop' of https://github.com/almende/vis into develop
yotamberk ffa8e0e
Merge branch 'develop' of https://github.com/almende/vis into develop
yotamberk 3147510
Add mouseup, mousedown, mouseover, click and dblclick events on timeline
yotamberk 216c24a
Add docs
yotamberk 64ab982
Add to evenlistener example
yotamberk 8729bc9
Add mousemove event listener
yotamberk 87ae409
Fix example
yotamberk 8b95ddd
Merge branch 'develop' of https://github.com/almende/vis into event-bugs
yotamberk c0f541b
Remove mouseUp and mouseDown events and fix docs for mouseOver
yotamberk 9c42bb4
Remove mouseUp and mouseDown from example
yotamberk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,15 +127,21 @@ function Timeline (container, items, groups, options) { | |
| this.itemsData = null; // DataSet | ||
| this.groupsData = null; // DataSet | ||
|
|
||
| this.on('tap', function (event) { | ||
| this.dom.root.onclick = function (event) { | ||
| me.emit('click', me.getEventProperties(event)) | ||
| }); | ||
| this.on('doubletap', function (event) { | ||
| }; | ||
| this.dom.root.ondblclick = function (event) { | ||
| me.emit('doubleClick', me.getEventProperties(event)) | ||
| }); | ||
| }; | ||
| this.dom.root.oncontextmenu = function (event) { | ||
| me.emit('contextmenu', me.getEventProperties(event)) | ||
| }; | ||
| this.dom.root.onmouseover = function (event) { | ||
| me.emit('mouseOver', me.getEventProperties(event)) | ||
| }; | ||
| this.dom.root.onmousemove = function (event) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we really want to emit this event. This happens quite often? What is the usecase for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see a use for it when someone wants a tooltip appearing any time you're on the timeline and want to see the exact time you are hovering on |
||
| me.emit('mouseMove', me.getEventProperties(event)) | ||
| }; | ||
|
|
||
| //Single time autoscale/fit | ||
| this.fitDone = false; | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you make sure this still workes on mobile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I have a touch screen on my computer and it seems to work fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool! But we should test it on mobile devices. It's possible that your screen emulates mouse events. I'll try to have a look on some devices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Np
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, looks good on Android and iOS.