From 586a586e60cf1a76273c217d62ce64c59fbe458c Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 21 Feb 2015 02:47:13 -0800 Subject: [PATCH] remove mouse comments. fix removeHover. --- lib/program.js | 18 ------------------ lib/widget.js | 5 +++++ 2 files changed, 5 insertions(+), 18 deletions(-) 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();