mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-28 05:26:10 +02:00
General bug fixes
This commit is contained in:
parent
1bc9830202
commit
10c9ea9554
4 changed files with 19 additions and 65 deletions
|
@ -21,7 +21,8 @@ function ButtonView(options) {
|
|||
util.inherits(ButtonView, TextView);
|
||||
|
||||
ButtonView.prototype.onKeyPress = function(ch, key) {
|
||||
if(this.isKeyMapped('accept', key.name) || ' ' === ch) {
|
||||
let actionForKeyName = key ? key.name : ch;
|
||||
if(this.isKeyMapped('accept', actionForKeyName) || ' ' === ch) {
|
||||
this.submitData = 'accept';
|
||||
this.emit('action', 'accept');
|
||||
delete this.submitData;
|
||||
|
@ -29,16 +30,6 @@ ButtonView.prototype.onKeyPress = function(ch, key) {
|
|||
ButtonView.super_.prototype.onKeyPress.call(this, ch, key);
|
||||
}
|
||||
};
|
||||
/*
|
||||
ButtonView.prototype.onKeyPress = function(ch, key) {
|
||||
// allow space = submit
|
||||
if(' ' === ch) {
|
||||
this.emit('action', 'accept');
|
||||
}
|
||||
|
||||
ButtonView.super_.prototype.onKeyPress.call(this, ch, key);
|
||||
};
|
||||
*/
|
||||
|
||||
ButtonView.prototype.getData = function() {
|
||||
return this.submitData || null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue