|
|
@ -174,11 +174,15 @@ Core.prototype._create = function (container) { |
|
|
|
this.emit('mousewheel', event); |
|
|
|
} |
|
|
|
|
|
|
|
// prevent scrolling if not specified explicitly or when horizontalScroll is true
|
|
|
|
if (!this.options.verticalScroll || this.options.horizontalScroll) return; |
|
|
|
|
|
|
|
// prevent scrolling when zoomKey defined or activated
|
|
|
|
if (!this.options.zoomKey || event[this.options.zoomKey]) return |
|
|
|
if (!this.options.zoomKey || event[this.options.zoomKey]) return; |
|
|
|
|
|
|
|
// prevent scrolling vertically when horizontalScroll is true
|
|
|
|
if (this.options.horizontalScroll) return |
|
|
|
// Prevent default actions caused by mouse wheel
|
|
|
|
// (else the page and timeline both scroll)
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
|
|
var delta = 0; |
|
|
|
if (event.wheelDelta) { /* IE/Opera. */ |
|
|
@ -194,17 +198,9 @@ Core.prototype._create = function (container) { |
|
|
|
|
|
|
|
if (this.isActive()) { |
|
|
|
this._setScrollTop(adjusted); |
|
|
|
if (this.options.verticalScroll) { |
|
|
|
this.dom.left.parentNode.scrollTop = -adjusted; |
|
|
|
this.dom.right.parentNode.scrollTop = -adjusted; |
|
|
|
} |
|
|
|
this._redraw(); |
|
|
|
this.emit('scroll', event); |
|
|
|
} |
|
|
|
|
|
|
|
// Prevent default actions caused by mouse wheel
|
|
|
|
// (else the page and timeline both scroll)
|
|
|
|
event.preventDefault(); |
|
|
|
} |
|
|
|
|
|
|
|
if (this.dom.centerContainer.addEventListener) { |
|
|
@ -1204,6 +1200,11 @@ Core.prototype._updateScrollTop = function () { |
|
|
|
if (this.props.scrollTop > 0) this.props.scrollTop = 0; |
|
|
|
if (this.props.scrollTop < scrollTopMin) this.props.scrollTop = scrollTopMin; |
|
|
|
|
|
|
|
if (this.options.verticalScroll) { |
|
|
|
this.dom.left.parentNode.scrollTop = -this.props.scrollTop; |
|
|
|
this.dom.right.parentNode.scrollTop = -this.props.scrollTop; |
|
|
|
} |
|
|
|
|
|
|
|
return this.props.scrollTop; |
|
|
|
}; |
|
|
|
|
|
|
|