remove mouse comments. fix removeHover.

This commit is contained in:
Christopher Jeffrey 2015-02-21 02:47:13 -08:00
parent 5d72fb1938
commit 586a586e60
2 changed files with 5 additions and 18 deletions

View File

@ -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'

View File

@ -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();