remove radio-button handling from checkbox.

This commit is contained in:
Christopher Jeffrey 2013-07-29 19:22:50 -05:00
parent 33214ee924
commit ac88ceaebe
1 changed files with 8 additions and 9 deletions

View File

@ -3065,6 +3065,8 @@ Element.prototype.render = function() {
return coords; return coords;
}; };
Element.prototype._render = Element.prototype.render;
Element.prototype.insertLine = function(i, line) { Element.prototype.insertLine = function(i, line) {
if (typeof line === 'string') line = line.split('\n'); if (typeof line === 'string') line = line.split('\n');
@ -4415,7 +4417,6 @@ Textarea.prototype.cancel = function() {
return this.__listener('\x1b', { name: 'escape' }); return this.__listener('\x1b', { name: 'escape' });
}; };
Textarea.prototype._render = Box.prototype.render;
Textarea.prototype.render = function() { Textarea.prototype.render = function() {
this.setValue(); this.setValue();
return this._render(); return this._render();
@ -4624,7 +4625,6 @@ ProgressBar.prototype.__proto__ = Input.prototype;
ProgressBar.prototype.type = 'progress-bar'; ProgressBar.prototype.type = 'progress-bar';
ProgressBar.prototype._render = ProgressBar.prototype.render;
ProgressBar.prototype.render = function() { ProgressBar.prototype.render = function() {
var ret = this._render(); var ret = this._render();
if (!ret) return; if (!ret) return;
@ -4902,13 +4902,8 @@ Checkbox.prototype.__proto__ = Input.prototype;
Checkbox.prototype.type = 'checkbox'; Checkbox.prototype.type = 'checkbox';
Checkbox.prototype._render = Checkbox.prototype.render;
Checkbox.prototype.render = function() { Checkbox.prototype.render = function() {
if (this.type === 'radio-button') {
this.setContent('(' + (this.checked ? '*' : ' ') + ') ' + this.text);
} else {
this.setContent('[' + (this.checked ? 'x' : ' ') + '] ' + this.text); this.setContent('[' + (this.checked ? 'x' : ' ') + '] ' + this.text);
}
return this._render(); return this._render();
}; };
@ -4984,6 +4979,11 @@ RadioButton.prototype.__proto__ = Checkbox.prototype;
RadioButton.prototype.type = 'radio-button'; RadioButton.prototype.type = 'radio-button';
RadioButton.prototype.render = function() {
this.setContent('(' + (this.checked ? '*' : ' ') + ') ' + this.text);
return this._render();
};
RadioButton.prototype.toggle = RadioButton.prototype.check; RadioButton.prototype.toggle = RadioButton.prototype.check;
/** /**
@ -5478,7 +5478,6 @@ Listbar.prototype.setItems = function(commands) {
this.select(0); this.select(0);
}; };
Listbar.prototype._render = Listbar.prototype.render;
Listbar.prototype.render = function() { Listbar.prototype.render = function() {
var self = this var self = this
, drawn = 0; , drawn = 0;