datetimepicker
datetimepicker copied to clipboard
Month and Year dropdowns are scrolling the wrong way
In the latest release (the one with the botched %npm_package_version%
tag name), the Month and Year dropdowns are scrolling in the opposite direction to the mousewheel. If I scroll up, it scrolls down, and vice versa.
I rolled back to 2.5.20
to see if it was a recent regression, and in that version these dropdowns scroll in the correct direction, so yeah.
I'm using Firefox in Debian Stretch, if that in any way matters. I'm strapped for time at the mo so I can't test another browser.
I did a little rollback, for me it helped. see, I commented out new top variable and got it from version 2.5.20
timeboxparent.on('mousewheel', function (event) {
//var deltaY = getWheelDelta(event.originalEvent);
//var top = Math.max(0, timeboxTop - deltaY);
//rollback to 2.5.20. reverse scroll workaround
var top = Math.abs(parseInt(timebox.css('marginTop'), 10));
top = top - (event.deltaY * 20);
tested on Chrome, FF
Thanks @el-o, I was using minified version. Based on your idea, I changed jquery.datetimepicker.full.min.js code as:
Replaced this line:
r=Math.max(0,f-n);
by:
r=Math.abs(parseInt(o.css('marginTop'),10));r=r-(e.deltaY*20);