Browse Source

Revert "Prevent of creating inline editor inside textarea."

This reverts commit 0e619820992a7e366c34cd5df20ef4ca011bdf04.
Mateusz Samsel 6 years ago
parent
commit
e8d53a0194
1 changed files with 25 additions and 24 deletions
  1. 25 24
      packages/ckeditor5-editor-inline/src/inlineeditor.js

+ 25 - 24
packages/ckeditor5-editor-inline/src/inlineeditor.js

@@ -188,30 +188,31 @@ export default class InlineEditor extends Editor {
 	 * @returns {Promise} A promise resolved once the editor is ready. The promise resolves with the created editor instance.
 	 */
 	static create( sourceElementOrData, config = {} ) {
-		let editor;
-		return Editor.allowedElement( sourceElementOrData )
-			.then( () => {
-				editor = new this( sourceElementOrData, config );
-			} )
-			.then( () => editor.initPlugins() )
-			.then( () => {
-				editor.ui.init();
-			} )
-			.then( () => {
-				if ( !isElement( sourceElementOrData ) && config.initialData ) {
-					// Documented in core/editor/editorconfig.jdoc.
-					throw new CKEditorError(
-						'editor-create-initial-data: ' +
-						'The config.initialData option cannot be used together with initial data passed in Editor.create().'
-					);
-				}
-
-				const initialData = config.initialData || getInitialData( sourceElementOrData );
-
-				return editor.data.init( initialData );
-			} )
-			.then( () => editor.fire( 'ready' ) )
-			.then( () => editor );
+		return new Promise( resolve => {
+			const editor = new this( sourceElementOrData, config );
+
+			resolve(
+				editor.initPlugins()
+					.then( () => {
+						editor.ui.init();
+					} )
+					.then( () => {
+						if ( !isElement( sourceElementOrData ) && config.initialData ) {
+							// Documented in core/editor/editorconfig.jdoc.
+							throw new CKEditorError(
+								'editor-create-initial-data: ' +
+								'The config.initialData option cannot be used together with initial data passed in Editor.create().'
+							);
+						}
+
+						const initialData = config.initialData || getInitialData( sourceElementOrData );
+
+						return editor.data.init( initialData );
+					} )
+					.then( () => editor.fire( 'ready' ) )
+					.then( () => editor )
+			);
+		} );
 	}
 }