Skip to content

Commit

Permalink
a better solution for e.offsetX/Y in Firefox based on http://stackove…
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Oct 9, 2013
1 parent 8997fa7 commit 4da53ef
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions inst/www/shared/shiny.js
Original file line number Diff line number Diff line change
Expand Up @@ -1050,11 +1050,10 @@
y: mouseEvent.offsetY
};
}

var origEvent = mouseEvent.originalEvent || {};
var offset = $el.offset();
return {
x: origEvent.layerX - origEvent.target.offsetLeft,
y: origEvent.layerY - origEvent.target.offsetTop
x: mouseEvent.pageX - offset.left,
y: mouseEvent.pageY - offset.top
};
}

Expand Down

0 comments on commit 4da53ef

Please sign in to comment.