* Re-attach events when switching between menu

This commit is contained in:
Bryan Ashby 2015-07-09 16:28:44 -06:00
parent eea09dd3b3
commit 52288a6162
2 changed files with 15 additions and 8 deletions

View File

@ -1052,7 +1052,7 @@ MultiLineEditTextView.prototype.setText = function(text) {
//this.textLines = [ { text : '' } ];
//this.insertRawText('');
//text = "Tab:\r\n\tA\tB\tC\tD\tE\tF\tG\r\n reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeally long word!!!";
text = require('fs').readFileSync('/home/nuskooler/Downloads/test_text.txt', { encoding : 'utf-8'});
text = require('fs').readFileSync('/home/bashby/Downloads/test_text.txt', { encoding : 'utf-8'});
this.insertRawText(text);//, 0, 0);
this.cursorEndOfDocument();

View File

@ -231,19 +231,25 @@ function FullScreenEditorModule(options) {
}
};
this.observeEditEvents = function() {
var bodyView = self.getBodyView();
bodyView.on('edit position', function cursorPosUpdate(pos) {
self.updateEditModePosition(pos);
});
bodyView.on('text edit mode', function textEditMode(mode) {
self.updateTextEditMode(mode);
});
};
this.menuMethods = {
headerSubmit : function(formData, extraArgs) {
self.viewControllers.header.setFocus(false);
self.viewControllers.body.switchFocus(1);
self.getBodyView().on('edit position', function cursorPosUpdate(pos) {
self.updateEditModePosition(pos);
});
self.getBodyView().on('text edit mode', function textEditMode(mode) {
self.updateTextEditMode(mode);
});
self.observeEditEvents();
},
editModeEscPressed : function(formData, extraArgs) {
console.log('editorModeBefore=' + self.editorMode)
@ -261,6 +267,7 @@ function FullScreenEditorModule(options) {
self.viewControllers.footerEditMenu.setFocus(false);
}
self.viewControllers.body.switchFocus(1);
self.observeEditEvents();
break;
case 'editMenu' :