Skip to content

Commit

Permalink
Merge pull request #3 from mayasabha/issue-1
Browse files Browse the repository at this point in the history
added ready event emitter
  • Loading branch information
apoorvpal01 authored Aug 30, 2022
2 parents f6aec56 + d4b81ae commit 03a23b0
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ export default {
} );
},

data() {
return {
readyEmitted: false,
};
},

beforeDestroy() {
if ( this.instance ) {
this.instance.destroy();
Expand Down Expand Up @@ -131,10 +137,18 @@ export default {
/* this.$on( 'input', () => {
this.$emit( 'ready', this.instance );
} ); */

if (!this.readyEmitted) {
this.$emit( 'ready', this.instance );
console.log('Emitting Ready');
this.readyEmitted = true;
}
this.$emit( 'update:modelValue', newData );
} else {
this.$emit( 'ready', this.instance );
if (!this.readyEmitted) {
this.$emit( 'ready', this.instance );
console.log('Emitting Ready');
this.readyEmitted = true;
}
}

this.instance.fire( 'unlockSnapshot' );
Expand Down

0 comments on commit 03a23b0

Please sign in to comment.