* Re-attach events when switching between menu
This commit is contained in:
parent
eea09dd3b3
commit
52288a6162
|
@ -1052,7 +1052,7 @@ MultiLineEditTextView.prototype.setText = function(text) {
|
||||||
//this.textLines = [ { text : '' } ];
|
//this.textLines = [ { text : '' } ];
|
||||||
//this.insertRawText('');
|
//this.insertRawText('');
|
||||||
//text = "Tab:\r\n\tA\tB\tC\tD\tE\tF\tG\r\n reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeally long word!!!";
|
//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.insertRawText(text);//, 0, 0);
|
||||||
this.cursorEndOfDocument();
|
this.cursorEndOfDocument();
|
||||||
|
|
21
mods/fse.js
21
mods/fse.js
|
@ -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 = {
|
this.menuMethods = {
|
||||||
headerSubmit : function(formData, extraArgs) {
|
headerSubmit : function(formData, extraArgs) {
|
||||||
self.viewControllers.header.setFocus(false);
|
self.viewControllers.header.setFocus(false);
|
||||||
self.viewControllers.body.switchFocus(1);
|
self.viewControllers.body.switchFocus(1);
|
||||||
|
|
||||||
self.getBodyView().on('edit position', function cursorPosUpdate(pos) {
|
self.observeEditEvents();
|
||||||
self.updateEditModePosition(pos);
|
|
||||||
});
|
|
||||||
|
|
||||||
self.getBodyView().on('text edit mode', function textEditMode(mode) {
|
|
||||||
self.updateTextEditMode(mode);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
editModeEscPressed : function(formData, extraArgs) {
|
editModeEscPressed : function(formData, extraArgs) {
|
||||||
console.log('editorModeBefore=' + self.editorMode)
|
console.log('editorModeBefore=' + self.editorMode)
|
||||||
|
@ -261,6 +267,7 @@ function FullScreenEditorModule(options) {
|
||||||
self.viewControllers.footerEditMenu.setFocus(false);
|
self.viewControllers.footerEditMenu.setFocus(false);
|
||||||
}
|
}
|
||||||
self.viewControllers.body.switchFocus(1);
|
self.viewControllers.body.switchFocus(1);
|
||||||
|
self.observeEditEvents();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'editMenu' :
|
case 'editMenu' :
|
||||||
|
|
Loading…
Reference in New Issue