mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-21 18:25:55 +02:00
* Fix bug assigning wrong default submit view ID
This commit is contained in:
parent
0d2d2602cd
commit
1f409435f4
3 changed files with 10 additions and 7 deletions
|
@ -1052,7 +1052,7 @@ MultiLineEditTextView.prototype.setText = function(text) {
|
||||||
//this.textLines = [ { text : '' } ];
|
//this.textLines = [ { text : '' } ];
|
||||||
//this.insertRawText('');
|
//this.insertRawText('');
|
||||||
//text = "Tab:\r\n\tA\tB\tC\tD\tE\tF\tG\r\n reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeally long word!!!";
|
//text = "Tab:\r\n\tA\tB\tC\tD\tE\tF\tG\r\n reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeally long word!!!";
|
||||||
text = require('fs').readFileSync('/home/nuskooler/Downloads/test_text.txt', { encoding : 'utf-8'});
|
text = require('fs').readFileSync('/home/bashby/Downloads/test_text.txt', { encoding : 'utf-8'});
|
||||||
|
|
||||||
this.insertRawText(text);//, 0, 0);
|
this.insertRawText(text);//, 0, 0);
|
||||||
this.cursorEndOfDocument();
|
this.cursorEndOfDocument();
|
||||||
|
|
|
@ -207,9 +207,10 @@ View.prototype.setPropertyValue = function(propName, value) {
|
||||||
case 'submit' :
|
case 'submit' :
|
||||||
if(_.isBoolean(value)) {
|
if(_.isBoolean(value)) {
|
||||||
this.submit = value;
|
this.submit = value;
|
||||||
} else {
|
}/* else {
|
||||||
this.submit = _.isArray(value) && value.length > 0;
|
this.submit = _.isArray(value) && value.length > 0;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'submitArgName' : this.submitArgName = value; break;
|
case 'submitArgName' : this.submitArgName = value; break;
|
||||||
|
|
|
@ -84,7 +84,6 @@ function ViewController(options) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'accept' : // :TODO: consider naming this 'done'
|
case 'accept' : // :TODO: consider naming this 'done'
|
||||||
// :TODO: check if id is submit, etc.
|
|
||||||
if(self.focusedView && self.focusedView.submit) {
|
if(self.focusedView && self.focusedView.submit) {
|
||||||
self.submitForm();
|
self.submitForm();
|
||||||
} else {
|
} else {
|
||||||
|
@ -177,6 +176,10 @@ function ViewController(options) {
|
||||||
var viewId = parseInt(mciMatch[2]);
|
var viewId = parseInt(mciMatch[2]);
|
||||||
assert(!isNaN(viewId));
|
assert(!isNaN(viewId));
|
||||||
|
|
||||||
|
if(viewId > highestId) {
|
||||||
|
highestId = viewId;
|
||||||
|
}
|
||||||
|
|
||||||
var view = self.getView(viewId);
|
var view = self.getView(viewId);
|
||||||
|
|
||||||
if(!view) {
|
if(!view) {
|
||||||
|
@ -208,7 +211,6 @@ function ViewController(options) {
|
||||||
nextItem(null);
|
nextItem(null);
|
||||||
},
|
},
|
||||||
function complete(err) {
|
function complete(err) {
|
||||||
|
|
||||||
// default to highest ID if no 'submit' entry present
|
// default to highest ID if no 'submit' entry present
|
||||||
if(!submitId) {
|
if(!submitId) {
|
||||||
self.getView(highestId).submit = true;
|
self.getView(highestId).submit = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue