-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Conversation
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.
This drops support for IE 6/7/8 since it always uses addEventListener now instead of attachEvent for those browsers.
lib/timeline/Core.js
Outdated
document.onmousewheel !== undefined ? "mousewheel" : // Webkit and IE support at least "mousewheel" | ||
this.dom.centerContainer.addEventListener ? "DOMMouseScroll" : // Older Firefox versions like "DOMMouseScroll" | ||
"onmousewheel" // All the rest should be comfortable with "onmousewheel" | ||
this.dom.centerContainer.addEventListener(wheelType, onMouseWheel.bind(this), false); |
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.
Use attachEvent
here in case addEventListener
is not supported (IE < 9).
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.
That's right. Thank you!
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.
Uses the spec-conforming "wheel" event for new browsers that support it, behaving more appropriately.
Does not change behaviour for other browsers.
I'm trying this in firefox quantum, and it isn't having any effect at all.... It still moves in micrometers when scrolling with the mousewheel, or dragging the scrollbar, etc. |
@SpeedHighway: |
Actually, no. I just tried this fix, by itself, because we're using vis through npm. I'm not sure of how I can get wildyeast's branch, doing it this way. EDIT: Okay, I built directly from wildyeast's fork and it does work. Using the scrollbar or arrows on the scrollbar still work horribly, but the mouse wheel works, at the very least. :) |
Nice! Thanks for giving it a try 👍 |
Hi @wildyeast , |
@yotamberk We have switched to your fork. Thank you for your time! |
* Normalize mouse wheel deltas for almende#3792 * include support for IE6/7/8
This fix normalizes the mouse wheel delta values and enables reasonable scrolling in Firefox (see #3792). Timeline now uses the wheel event if supported by the browser.
Relevant examples:
timeline/other/horizontalScroll.html
andverticalScroll.html