From c8bcb6f0b6269964f59ff66b20314efbeac373fe Mon Sep 17 00:00:00 2001 From: Brett Kinnamon Date: Wed, 19 Feb 2020 15:52:08 -0500 Subject: [PATCH] wait until the editor is created to initialize the listeners --- src/examples/App.vue | 178 +++++++++++++++++++++++++++---------------- src/vue-froala.js | 10 +-- 2 files changed, 115 insertions(+), 73 deletions(-) diff --git a/src/examples/App.vue b/src/examples/App.vue index 3abc0e8..989810b 100644 --- a/src/examples/App.vue +++ b/src/examples/App.vue @@ -1,14 +1,13 @@ - diff --git a/src/vue-froala.js b/src/vue-froala.js index b5ca8d0..790fd87 100644 --- a/src/vue-froala.js +++ b/src/vue-froala.js @@ -90,15 +90,13 @@ export default (Vue, Options = {}) => { this.currentConfig = this.config || this.defaultConfig; + this._editor = new FroalaEditor(this.$el, this.currentConfig, () => { + this.initListeners(); + this.editorInitialized = true; + }); this.setContent(true); - // Bind editor events. this.registerEvents(); - this.initListeners(); - - this._editor = new FroalaEditor(this.$el, this.currentConfig) - - this.editorInitialized = true; },