* @param {Editor} editor
*/
export function listen(editor) {
-
// Replace editor content
window.$events.listen('editor::replace', ({html}) => {
editor.setContent(html);
// Focus on the editor
window.$events.listen('editor::focus', () => {
- editor.focus();
+ if (editor.initialized) {
+ editor.focus();
+ }
});
-}
\ No newline at end of file
+}