Browse Source

Fixes #2336 mouse wheel problem on custom time element (#2366)

* Fix mouse zoom on currentTime
* Fix customTime mousewheel bug
codeClimate
yotamberk 8 years ago
committed by Alexander Wunschik
parent
commit
d779efe3f3
2 changed files with 16 additions and 1 deletions
  1. +15
    -1
      lib/timeline/component/CustomTime.js
  2. +1
    -0
      lib/timeline/component/css/currenttime.css

+ 15
- 1
lib/timeline/component/CustomTime.js View File

@ -77,8 +77,22 @@ CustomTime.prototype._create = function() {
drag.style.left = '-10px';
drag.style.height = '100%';
drag.style.width = '20px';
bar.appendChild(drag);
function onMouseWheel (e) {
this.body.range._onMouseWheel(e);
}
if (drag.addEventListener) {
// IE9, Chrome, Safari, Opera
drag.addEventListener("mousewheel", onMouseWheel.bind(this), false);
// Firefox
drag.addEventListener("DOMMouseScroll", onMouseWheel.bind(this), false);
} else {
// IE 6/7/8
drag.attachEvent("onmousewheel", onMouseWheel.bind(this));
}
bar.appendChild(drag);
// attach event listeners
this.hammer = new Hammer(drag);
this.hammer.on('panstart', this._onDragStart.bind(this));

+ 1
- 0
lib/timeline/component/css/currenttime.css View File

@ -2,4 +2,5 @@
background-color: #FF7F6E;
width: 2px;
z-index: 1;
pointer-events: none;
}

Loading…
Cancel
Save