Apply deltaFactor for the delta calculation of mousewheel.
This commit is contained in:
parent
9225275e6c
commit
fdcedcbbf5
@ -277,10 +277,16 @@
|
|||||||
|
|
||||||
// bind handlers
|
// bind handlers
|
||||||
var bindMouseWheelHandler = function () {
|
var bindMouseWheelHandler = function () {
|
||||||
|
// FIXME: Backward compatibility.
|
||||||
|
// After e.deltaFactor applied, wheelSpeed should have smaller value.
|
||||||
|
// Currently, there's no way to change the settings after the scrollbar initialized.
|
||||||
|
// But if the way is implemented in the future, wheelSpeed should be reset.
|
||||||
|
settings.wheelSpeed /= 10;
|
||||||
|
|
||||||
var shouldPrevent = false;
|
var shouldPrevent = false;
|
||||||
$this.bind('mousewheel' + eventClassName, function (e, deprecatedDelta, deprecatedDeltaX, deprecatedDeltaY) {
|
$this.bind('mousewheel' + eventClassName, function (e, deprecatedDelta, deprecatedDeltaX, deprecatedDeltaY) {
|
||||||
var deltaX = e.deltaX || deprecatedDeltaX,
|
var deltaX = e.deltaX * e.deltaFactor || deprecatedDeltaX,
|
||||||
deltaY = e.deltaY || deprecatedDeltaY;
|
deltaY = e.deltaY * e.deltaFactor || deprecatedDeltaY;
|
||||||
|
|
||||||
if (!settings.useBothWheelAxes) {
|
if (!settings.useBothWheelAxes) {
|
||||||
// deltaX will only be used for horizontal scrolling and deltaY will
|
// deltaX will only be used for horizontal scrolling and deltaY will
|
||||||
|
Loading…
Reference in New Issue
Block a user