Good progress on 2FA/OTP config

This commit is contained in:
Bryan Ashby 2019-05-24 22:27:50 -06:00
parent b62f55961f
commit 8802ae24ba
No known key found for this signature in database
GPG key ID: B49EB437951D2542
7 changed files with 230 additions and 10 deletions

View file

@ -35,11 +35,16 @@ util.inherits(ToggleMenuView, MenuView);
ToggleMenuView.prototype.redraw = function() {
ToggleMenuView.super_.prototype.redraw.call(this);
if(0 === this.items.length) {
return;
}
//this.cachePositions();
this.client.term.write(this.hasFocus ? this.getFocusSGR() : this.getSGR());
assert(this.items.length === 2);
assert(this.items.length === 2, 'ToggleMenuView must contain exactly (2) items');
for(var i = 0; i < 2; i++) {
var item = this.items[i];
var text = strUtil.stylizeString(
@ -102,7 +107,7 @@ ToggleMenuView.prototype.onKeyPress = function(ch, key) {
if(key) {
if(this.isKeyMapped('right', key.name) || this.isKeyMapped('down', key.name)) {
this.focusNext();
} else if(this.isKeyMapped('left', key.name) || this.isKeyMapped('up', key.nam4e)) {
} else if(this.isKeyMapped('left', key.name) || this.isKeyMapped('up', key.name)) {
this.focusPrevious();
}
}