Fixed IME in editor

This commit is contained in:
benweet 2014-05-04 18:30:14 +01:00
parent 68cce3a472
commit 61e472d7f0

View File

@ -43,9 +43,12 @@ define([
pagedownEditor = pagedownEditorParam;
});
var isComposing;
eventMgr.addListener('onSectionsCreated', function(newSectionList) {
updateSectionList(newSectionList);
highlightSections();
if(!isComposing) {
updateSectionList(newSectionList);
highlightSections();
}
if(fileChanged === true) {
// Refresh preview synchronously
pagedownEditor.refreshPreview();
@ -727,6 +730,14 @@ define([
clearNewline = false;
}
})
.on('compositionstart', function() {
isComposing = true;
console.log('compositionstart');
})
.on('compositionend', function() {
isComposing = false;
console.log('compositionend');
})
.on('mouseup', _.bind(selectionMgr.saveSelectionState, selectionMgr, true))
.on('paste', function() {
undoMgr.currentMode = 'paste';