* Minor work on fse class. Experimental handling of submit/etc. directly

This commit is contained in:
Bryan Ashby 2015-08-12 22:08:33 -06:00
parent 40e1e1bea8
commit 08bebb560d
4 changed files with 61 additions and 0 deletions

View File

@ -255,6 +255,11 @@ function FullScreenEditor(options) {
from.acceptsFocus = false; from.acceptsFocus = false;
from.setText(self.client.user.username); from.setText(self.client.user.username);
callback(null);
},
function setInitialFocus(callback) {
self.viewControllers.body.setFocus(false);
self.viewControllers.header.switchFocus(2);
callback(null); callback(null);
} }
], ],
@ -263,6 +268,15 @@ function FullScreenEditor(options) {
} }
); );
}; };
this.initObservers = function() {
this.viewControllers.header.on('submit', function headerSubmit(formData, extraArgs) {
if(formData.id === self.getFormId('header')) {
self.viewControllers.header.setFocus(false);
self.viewControllers.body.switchFocus(1);
}
});
};
} }
require('util').inherits(FullScreenEditor, events.EventEmitter); require('util').inherits(FullScreenEditor, events.EventEmitter);
@ -283,6 +297,10 @@ FullScreenEditor.prototype.enter = function() {
self.createInitialViews(function viewsCreated(err) { self.createInitialViews(function viewsCreated(err) {
callback(err); callback(err);
}); });
},
function prepObservers(callback) {
self.initObservers();
callback(null);
} }
], ],
function complete(err) { function complete(err) {
@ -294,3 +312,5 @@ FullScreenEditor.prototype.enter = function() {
FullScreenEditor.prototype.leave = function() { FullScreenEditor.prototype.leave = function() {
}; };

Binary file not shown.

View File

@ -275,6 +275,41 @@
"footerView" : "demo_fse_netmail_footer_view.ans", "footerView" : "demo_fse_netmail_footer_view.ans",
"help" : "demo_fse_netmail_help.ans" "help" : "demo_fse_netmail_help.ans"
} }
},
"form" : {
"0" : {
"ETETTLTL" : {
"mci" : {
"TL1" : {
"width" : 36,
"argName" : "from"
},
"ET2" : {
"width" : 36,
"argName" : "to",
"focus" : true
},
"ET3" : {
"width" : 65,
"argName" : "subject",
"maxLength" : 72,
"submit" : true
},
"TL4" : {
"width" : 19,
"textOverflow" : "..."
}
}/*
"submit" : {
"3" : [
{
"value" : { "subject" : null },
"action" : "@method:fseSubmitProxy"
}
]
}*/
}
}
} }
}, },
/* /*

View File

@ -38,6 +38,12 @@ function MessageAreaPostModule(options) {
fse.enter(); fse.enter();
}; };
this.menuMethods = {
fseSubmitProxy : function(formData, extraArgs) {
console.log(formData)
}
};
} }
require('util').inherits(MessageAreaPostModule, MenuModule); require('util').inherits(MessageAreaPostModule, MenuModule);