Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

Commit

Permalink
Fix mousemove events for IE8
Browse files Browse the repository at this point in the history
Fixes #829
  • Loading branch information
nnarhinen committed Jun 4, 2015
1 parent 8d2257d commit 2b232e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/common.js
Expand Up @@ -139,13 +139,15 @@ common.offset = function(el) {
common.width = function(el, val) {
/*jshint -W093 */
if (val) return el.style.width = (''+val).replace(/px$/, '') + 'px';
return common.offset(el).width;
var ret = common.offset(el).width;
return typeof ret === 'undefined' ? el.offsetWidth : ret;
};

common.height = function(el, val) {
/*jshint -W093 */
if (val) return el.style.height = (''+val).replace(/px$/, '') + 'px';
return common.offset(el).height;
var ret = common.offset(el).height;
return typeof ret === 'undefined' ? el.offsetHeight : ret;
};

common.lastChild = function(el) {
Expand Down
2 changes: 1 addition & 1 deletion lib/ext/slider.js
Expand Up @@ -58,7 +58,7 @@ var slider = function(root, rtl) {
},

mousemove = function(e) {
var pageX = e.pageX;
var pageX = e.pageX || e.clientX;
if (!pageX && e.originalEvent && e.originalEvent.touches && e.originalEvent.touches.length) {
pageX = e.originalEvent.touches[0].pageX;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/ext/ui.js
Expand Up @@ -287,7 +287,7 @@ flowplayer(function(api, root) {
});

bean.on(root, 'mousemove', '.fp-timeline', function(ev) {
var x = ev.pageX,
var x = ev.pageX || ev.clientX,
delta = x - common.offset(timeline).left,
percentage = delta / common.width(timeline),
seconds = percentage * api.video.duration;
Expand Down

0 comments on commit 2b232e6

Please sign in to comment.