* 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.setText(self.client.user.username);
callback(null);
},
function setInitialFocus(callback) {
self.viewControllers.body.setFocus(false);
self.viewControllers.header.switchFocus(2);
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);
@ -283,6 +297,10 @@ FullScreenEditor.prototype.enter = function() {
self.createInitialViews(function viewsCreated(err) {
callback(err);
});
},
function prepObservers(callback) {
self.initObservers();
callback(null);
}
],
function complete(err) {
@ -294,3 +312,5 @@ FullScreenEditor.prototype.enter = function() {
FullScreenEditor.prototype.leave = function() {
};