* Pass 'key' object to actions & submit form events

This commit is contained in:
Bryan Ashby 2015-08-13 16:05:17 -06:00
parent 08bebb560d
commit 6d49e5e55f
5 changed files with 56 additions and 14 deletions

View file

@ -270,10 +270,18 @@ function FullScreenEditor(options) {
};
this.initObservers = function() {
// :TODO: Should probably still allow key mapping/etc. to come from module for this stuff
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);
// :TODO: we need to validate the "to" here
self.viewControllers.header.setFocus(false);
self.viewControllers.body.switchFocus(1);
});
this.viewControllers.body.on('submit', function bodySubmit(formData, extraArgs) {
if(formData.key && 'escape' === formData.key.name) {
console.log('toggle menu depending on mode...')
}
});
};