diff --git a/lib/program.js b/lib/program.js index b9ebc96..7cc1c18 100644 --- a/lib/program.js +++ b/lib/program.js @@ -715,24 +715,6 @@ Program.prototype._bindMouse = function(s, buf) { return; } - // pterm mouse - // if (parts = /^\x1b\[([\x00\u0020-\uffff]{3})/.exec(s)) { - // ; - // } - - // jsbterm mouse - // if (parts = /^\x1b\[0~zw([\x00\u0020-\uffff]{3})/.exec(s)) { - // ; - // } - - // net - // if (parts = /^\x1b}([\x00\u0020-\uffff]{3})/.exec(s)) { - // ; - // } - - // TODO: - // sysmouse - if (parts = /^\x1b\[(O|I)/.exec(s)) { key.action = parts[1] === 'I' ? 'focus' diff --git a/lib/widget.js b/lib/widget.js index 43ee042..70899e8 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -2516,10 +2516,13 @@ Element.prototype.setHover = function(options) { this._hover._.over = false; this.on('mouseover', function(data) { + if (!self._hover) return; self._hover._.over = true; }); this.on('mouse', function(data) { + if (!self._hover) return; + // XXX Does not work as well as it should: // if (!self._hover._.over) return; @@ -2541,12 +2544,14 @@ Element.prototype.setHover = function(options) { }); this.on('mouseout', function() { + if (!self._hover) return; self._hover._.over = false; self._hover.detach(); self.screen.render(); }); this.screen.on('element mouseover', function(el) { + if (!self._hover) return; if (el === self || el === self._hover) return; self._hover._.over = false; self._hover.detach();