fix for protected note freezing because of double initialization of CKEditor

This commit is contained in:
azivner
2018-08-28 15:03:23 +02:00
parent d31a136442
commit bc207d5e30
3 changed files with 17 additions and 6 deletions

View File

@@ -9,9 +9,13 @@ async function show() {
if (!textEditor) {
await libraryLoader.requireLibrary(libraryLoader.CKEDITOR);
textEditor = await BalloonEditor.create($noteDetailText[0], {});
// textEditor might have been initialized during previous await so checking again
// looks like double initialization can freeze CKEditor pretty badly
if (!textEditor) {
textEditor = await BalloonEditor.create($noteDetailText[0], {});
textEditor.model.document.on('change:data', noteDetailService.noteChanged);
textEditor.model.document.on('change:data', noteDetailService.noteChanged);
}
}
textEditor.setData(noteDetailService.getCurrentNote().content);