Merge pull request #63 from beardtree/click-fix
Fixes clicking when mousedown element != mouseup element
This commit is contained in:
commit
a1ea57eaf0
|
@ -480,8 +480,11 @@ Screen.prototype._listenMouse = function(el) {
|
|||
if (data.x >= pos.xi && data.x < pos.xl
|
||||
&& data.y >= pos.yi && data.y < pos.yl) {
|
||||
el.emit('mouse', data);
|
||||
if (data.action === 'mouseup') {
|
||||
el.emit('click', data);
|
||||
if (data.action === 'mousedown') {
|
||||
self.mouseDown = el;
|
||||
} else if (data.action === 'mouseup') {
|
||||
(self.mouseDown || el).emit('click', data);
|
||||
self.mouseDown = null;
|
||||
} else if (data.action === 'mousemove') {
|
||||
if (self.hover && el.index > self.hover.index) {
|
||||
set = false;
|
||||
|
|
Loading…
Reference in New Issue