|
@@ -119,6 +119,8 @@ export default class Editor {
|
|
|
* @member {'initializing'|'ready'|'destroyed'} #state
|
|
* @member {'initializing'|'ready'|'destroyed'} #state
|
|
|
*/
|
|
*/
|
|
|
this.set( 'state', 'initializing' );
|
|
this.set( 'state', 'initializing' );
|
|
|
|
|
+ this.once( 'ready', () => ( this.state = 'ready' ), { priority: 'high' } );
|
|
|
|
|
+ this.once( 'destroy', () => ( this.state = 'destroyed' ), { priority: 'high' } );
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Defines whether this editor is in read-only mode.
|
|
* Defines whether this editor is in read-only mode.
|
|
@@ -241,7 +243,6 @@ export default class Editor {
|
|
|
* @returns {Promise} A promise that resolves once the editor instance is fully destroyed.
|
|
* @returns {Promise} A promise that resolves once the editor instance is fully destroyed.
|
|
|
*/
|
|
*/
|
|
|
destroy() {
|
|
destroy() {
|
|
|
- this.state = 'destroyed';
|
|
|
|
|
this.fire( 'destroy' );
|
|
this.fire( 'destroy' );
|
|
|
|
|
|
|
|
this.stopListening();
|
|
this.stopListening();
|
|
@@ -287,7 +288,6 @@ export default class Editor {
|
|
|
editor.initPlugins()
|
|
editor.initPlugins()
|
|
|
.then( () => {
|
|
.then( () => {
|
|
|
editor.fire( 'dataReady' );
|
|
editor.fire( 'dataReady' );
|
|
|
- editor.state = 'ready';
|
|
|
|
|
editor.fire( 'ready' );
|
|
editor.fire( 'ready' );
|
|
|
} )
|
|
} )
|
|
|
.then( () => editor )
|
|
.then( () => editor )
|