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
|
if (data.x >= pos.xi && data.x < pos.xl
|
||||||
&& data.y >= pos.yi && data.y < pos.yl) {
|
&& data.y >= pos.yi && data.y < pos.yl) {
|
||||||
el.emit('mouse', data);
|
el.emit('mouse', data);
|
||||||
if (data.action === 'mouseup') {
|
if (data.action === 'mousedown') {
|
||||||
el.emit('click', data);
|
self.mouseDown = el;
|
||||||
|
} else if (data.action === 'mouseup') {
|
||||||
|
(self.mouseDown || el).emit('click', data);
|
||||||
|
self.mouseDown = null;
|
||||||
} else if (data.action === 'mousemove') {
|
} else if (data.action === 'mousemove') {
|
||||||
if (self.hover && el.index > self.hover.index) {
|
if (self.hover && el.index > self.hover.index) {
|
||||||
set = false;
|
set = false;
|
||||||
|
|
Loading…
Reference in New Issue