Skip to content

Commit

Permalink
Trying to fix issues #219 and #213
Browse files Browse the repository at this point in the history
  • Loading branch information
xavijam committed Jul 16, 2012
1 parent c5a30ba commit 95f93ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
1 change: 1 addition & 0 deletions control/lib/interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ wax.interaction = function() {
_d = wax.u.eventoffset(e);
if (e.type === 'mousedown') {
bean.add(document.body, 'click', onUp);
bean.add(document.body, 'mouseup', onUp);

// Only track single-touches. Double-touches will not affect this
// control
Expand Down
10 changes: 2 additions & 8 deletions control/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,9 @@ wax.u = {
};
} else if (e.clientX || e.clientY) {
// Internet Explorer
var doc = document.documentElement, body = document.body;
var htmlComputed = document.body.parentNode.currentStyle;
var topMargin = parseInt(htmlComputed.marginTop, 10) || 0;
var leftMargin = parseInt(htmlComputed.marginLeft, 10) || 0;
return {
x: e.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) -
(doc && doc.clientLeft || body && body.clientLeft || 0) + leftMargin,
y: e.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) -
(doc && doc.clientTop || body && body.clientTop || 0) + topMargin
x: e.clientX,
y: e.clientY
};
} else if (e.touches && e.touches.length === 1) {
// Touch browsers
Expand Down

0 comments on commit 95f93ca

Please sign in to comment.