-
Notifications
You must be signed in to change notification settings - Fork 1.5k
vertical scroll when zoomKey isn't triggered #2197
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.
see source comments
@@ -222,7 +251,7 @@ Core.prototype.setOptions = function (options) { | |||
var fields = [ | |||
'width', 'height', 'minHeight', 'maxHeight', 'autoResize', | |||
'start', 'end', 'clickToUse', 'dataAttributes', 'hiddenDates', | |||
'locale', 'locales', 'moment', 'rtl' | |||
'locale', 'locales', 'moment', 'rtl', 'zoomKey' |
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.
zoomKey
looks like a new option. I think we need some documentation for that.
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.
It's not new, it's simply not exposed in the core.js file so we need to expose it like this.
@@ -161,6 +161,35 @@ Core.prototype._create = function (container) { | |||
this.dom.root.addEventListener('mousewheel', onMouseWheel); |
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.
I would suggest to use the chance an change the existing mousewheel handler to something more generic:
if (this.dom.root.addEventListener) {
// IE9, Chrome, Safari, Opera
this.dom.root.addEventListener("mousewheel", MouseWheelHandler, false);
// Firefox
this.dom.root.addEventListener("DOMMouseScroll", MouseWheelHandler, false);
} else {
// IE 6/7/8
this.dom.root.attachEvent("onmousewheel", MouseWheelHandler);
}
event.preventDefault(); | ||
} | ||
|
||
this.dom.center.addEventListener('mousewheel', onMouseWheelCenter); |
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.
There is already a mousewheel handler on the root element. For performance-reasons we should only attach it once and reuse the onMouseWheel
function.
Fixed comments! On to the next PR |
No description provided.