From 08bebb560d8b39d0177f9f2bcb7ecf1b1dff24a9 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Wed, 12 Aug 2015 22:08:33 -0600 Subject: [PATCH] * Minor work on fse class. Experimental handling of submit/etc. directly --- core/fse--class.js | 20 +++++++++++++++++ mods/art/msg_area_post_header.ans | Bin 582 -> 582 bytes mods/menu.json | 35 ++++++++++++++++++++++++++++++ mods/msg_area_post.js | 6 +++++ 4 files changed, 61 insertions(+) diff --git a/core/fse--class.js b/core/fse--class.js index 2cf5b648..c2b09fb2 100644 --- a/core/fse--class.js +++ b/core/fse--class.js @@ -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() { }; + + diff --git a/mods/art/msg_area_post_header.ans b/mods/art/msg_area_post_header.ans index 0900ecd047367558e6cbb612042b6a86f874915d..7ea3a56f768a74065c0e2433a438fe03b4dd65e1 100644 GIT binary patch delta 20 acmX@ca*SodX{HdLiD$!s