|
@ -161,6 +161,35 @@ Core.prototype._create = function (container) { |
|
|
this.dom.root.addEventListener('mousewheel', onMouseWheel); |
|
|
this.dom.root.addEventListener('mousewheel', onMouseWheel); |
|
|
this.dom.root.addEventListener('DOMMouseScroll', onMouseWheel); |
|
|
this.dom.root.addEventListener('DOMMouseScroll', onMouseWheel); |
|
|
|
|
|
|
|
|
|
|
|
function onMouseWheelCenter(event) { |
|
|
|
|
|
// prevent scrolling when zoomKey defined or activated
|
|
|
|
|
|
if (!me.options.zoomKey || event[me.options.zoomKey]) return |
|
|
|
|
|
|
|
|
|
|
|
var delta = 0; |
|
|
|
|
|
if (event.wheelDelta) { /* IE/Opera. */ |
|
|
|
|
|
delta = event.wheelDelta / 120; |
|
|
|
|
|
} else if (event.detail) { /* Mozilla case. */ |
|
|
|
|
|
// In Mozilla, sign of delta is different than in IE.
|
|
|
|
|
|
// Also, delta is multiple of 3.
|
|
|
|
|
|
delta = -event.detail / 3; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var current = me.props.scrollTop; |
|
|
|
|
|
var adjusted = current + delta * 120; |
|
|
|
|
|
if (me.isActive()) { |
|
|
|
|
|
me._setScrollTop(adjusted); |
|
|
|
|
|
me._redraw(); |
|
|
|
|
|
me.emit('scroll', event); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Prevent default actions caused by mouse wheel
|
|
|
|
|
|
// (else the page and timeline both scroll)
|
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.dom.center.addEventListener('mousewheel', onMouseWheelCenter); |
|
|
|
|
|
this.dom.center.addEventListener('DOMMouseScroll', onMouseWheelCenter); |
|
|
|
|
|
|
|
|
// size properties of each of the panels
|
|
|
// size properties of each of the panels
|
|
|
this.props = { |
|
|
this.props = { |
|
|
root: {}, |
|
|
root: {}, |
|
@ -222,7 +251,7 @@ Core.prototype.setOptions = function (options) { |
|
|
var fields = [ |
|
|
var fields = [ |
|
|
'width', 'height', 'minHeight', 'maxHeight', 'autoResize', |
|
|
'width', 'height', 'minHeight', 'maxHeight', 'autoResize', |
|
|
'start', 'end', 'clickToUse', 'dataAttributes', 'hiddenDates', |
|
|
'start', 'end', 'clickToUse', 'dataAttributes', 'hiddenDates', |
|
|
'locale', 'locales', 'moment', 'rtl' |
|
|
|
|
|
|
|
|
'locale', 'locales', 'moment', 'rtl', 'zoomKey' |
|
|
]; |
|
|
]; |
|
|
util.selectiveExtend(fields, this.options, options); |
|
|
util.selectiveExtend(fields, this.options, options); |
|
|
|
|
|
|
|
|