Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Set context config from editor config if the editor is context host. …
Browse files Browse the repository at this point in the history
…Copy config from context to editor otherwise.
  • Loading branch information
Piotr Jasiun committed Nov 21, 2019
1 parent ae28a15 commit 2ae3783
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/editor/editor.js
Expand Up @@ -55,7 +55,7 @@ export default class Editor {
* @readonly
* @type {module:core/context~Context}
*/
this.context = config.context || new Context();
this.context = config.context || new Context( config );
this.context.addEditor( this );

/**
Expand All @@ -79,7 +79,9 @@ export default class Editor {
*/
this.config = new Config( config, this.constructor.defaultConfig );
this.config.define( 'plugins', availablePlugins );
this.config.define( this.context.getEditorConfig() );
if ( !this._isContextHost ) {
this.config.define( this.context.getEditorConfig() );
}

/**
* The plugins loaded and in use by this editor instance.
Expand Down

0 comments on commit 2ae3783

Please sign in to comment.