Skip to content

Commit

Permalink
Fix issue where there are parent containers and the offset gets mixed…
Browse files Browse the repository at this point in the history
… up.
  • Loading branch information
markmandel committed Oct 29, 2015
1 parent b7bf7ce commit 4167e0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
bower_components
node_modules
*.iml
4 changes: 2 additions & 2 deletions paper-audio-player.html
Expand Up @@ -423,8 +423,8 @@
var x, r,
player = this;

x = e.detail.x - player.offsetLeft - player.$.left.offsetWidth;
r = (x / player.$.progress.offsetWidth) * player.duration;
x = e.detail.x - player.$.progress.getBoundingClientRect().left;
r = (x / player.$.progress.getBoundingClientRect().width) * player.duration;
player.currentTime = player.$.audio.currentTime = r;
},

Expand Down

0 comments on commit 4167e0f

Please sign in to comment.