* Some more work on switching menus in FSE

This commit is contained in:
Bryan Ashby 2015-07-08 22:49:22 -06:00
parent 65ad2ffdd1
commit eea09dd3b3
2 changed files with 39 additions and 7 deletions

View File

@ -245,18 +245,37 @@ function FullScreenEditorModule(options) {
self.updateTextEditMode(mode); self.updateTextEditMode(mode);
}); });
}, },
editorEscPressed : function(formData, extraArgs) { editModeEscPressed : function(formData, extraArgs) {
//this.editorMode = 'edit' === this.editorMode ? 'editMenu' : 'edit'; console.log('editorModeBefore=' + self.editorMode)
self.editorMode = 'editMenu'; self.editorMode = 'edit' === self.editorMode ? 'editMenu' : 'edit';
console.log('editorModeAfter=' + self.editorMode)
//self.editorMode = 'editMenu';
self.switchFooter(function next(err) { self.switchFooter(function next(err) {
if(err) { if(err) {
// :TODO:... what now? // :TODO:... what now?
console.log(err) console.log(err)
} else { } else {
switch(self.editorMode) {
case 'edit' :
if(!_.isUndefined(self.viewControllers.footerEditMenu)) {
self.viewControllers.footerEditMenu.setFocus(false);
}
self.viewControllers.body.switchFocus(1);
break;
case 'editMenu' :
self.viewControllers.body.setFocus(false); self.viewControllers.body.setFocus(false);
self.viewControllers.footerEditMenu.switchFocus(1); self.viewControllers.footerEditMenu.switchFocus(1);
break;
default : throw new Error('Unexpected mode');
}
} }
}); });
},
editModeMenu1 : function(formData, extraArgs) {
console.log('menu 1')
} }
}; };
} }

View File

@ -523,7 +523,7 @@
"*" : [ "*" : [
{ {
"value" : 1, "value" : 1,
"action" : "@method:editorEscPressed" "action" : "@method:editModeEscPressed"
} }
] ]
} }
@ -545,8 +545,21 @@
"HM1" : { "HM1" : {
"mci" : { "mci" : {
"HM1" : { "HM1" : {
"items" : [ "Menu 1", "Menu 2", "Menu 3", "Menu 4" ] "items" : [ "Menu 1", "Menu 2", "Menu 3", "Menu 4" ],
"submit" : [ "escape" ]
} }
},
"submit" : {
"*" : [
{
"value" : { "1" : 1 },
"action" : "@method:editModeMenu1"
},
{
"value" : 1,
"action" : "@method:editModeEscPressed"
}
]
} }
} }
} }