1var editor_changed = false;
2
3editor.model.document.on('change:data', () => { editor_changed = true; });
4
5editor.ui.focusTracker.on('change:isFocused', (evt, name, isFocused) => {
6 if(!isFocused && editor_changed) {
7 editor_changed = false;
8 console.log(editor.getData());
9 }
10} );