mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Attempt to beter handle older browsers that use a wheelDelta based on 120
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
## 3.1.7-pre
|
||||
|
||||
* Better handle the `deltaMode` values 1 (lines) and 2 (pages)
|
||||
* Attempt to better handle older browsers that use a wheelDelta based on 120
|
||||
|
||||
## 3.1.6
|
||||
|
||||
|
@@ -139,6 +139,17 @@
|
||||
lowestDelta = absDelta;
|
||||
}
|
||||
|
||||
// Assuming that if the lowestDelta is 120, then that the browser
|
||||
// is treating this as an older mouse wheel event.
|
||||
// We'll divide it by 40 to try and get a more usable deltaFactor.
|
||||
if ( lowestDelta === 120 ) {
|
||||
// Divide all the things by 40!
|
||||
delta /= 40;
|
||||
deltaX /= 40;
|
||||
deltaY /= 40;
|
||||
lowestDelta /= 40;
|
||||
}
|
||||
|
||||
// Get a whole, normalized value for the deltas
|
||||
delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
|
||||
deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
|
||||
|
Reference in New Issue
Block a user