mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-09 10:42:02 +00:00
fix label reposition. fixes #134.
This commit is contained in:
parent
173f62c519
commit
da1ff18493
@ -980,11 +980,11 @@ Element.prototype.setLabel = function(options) {
|
|||||||
self.screen.render();
|
self.screen.render();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.on('scroll', function() {
|
this.on('scroll', this._labelScroll = function() {
|
||||||
reposition();
|
reposition();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on('resize', function() {
|
this.on('resize', this._labelResize = function() {
|
||||||
nextTick(function() {
|
nextTick(function() {
|
||||||
reposition();
|
reposition();
|
||||||
});
|
});
|
||||||
@ -994,6 +994,10 @@ Element.prototype.setLabel = function(options) {
|
|||||||
Element.prototype.removeLabel = function() {
|
Element.prototype.removeLabel = function() {
|
||||||
if (!this._label) return;
|
if (!this._label) return;
|
||||||
this._label.detach();
|
this._label.detach();
|
||||||
|
this.removeListener('scroll', this._labelScroll);
|
||||||
|
this.removeListener('resize', this._labelResize);
|
||||||
|
delete this._labelScroll;
|
||||||
|
delete this._labelResize;
|
||||||
delete this._label;
|
delete this._label;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user