8
0
Просмотр исходного кода

Added pluginName property and plugin dependency.

Oskar Wróbel 6 лет назад
Родитель
Сommit
a64cbd79db
1 измененных файлов с 16 добавлено и 2 удалено
  1. 16 2
      packages/ckeditor5-code-block/src/codeblockediting.js

+ 16 - 2
packages/ckeditor5-code-block/src/codeblockediting.js

@@ -8,7 +8,7 @@
  */
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
-
+import ShiftEnter from '@ckeditor/ckeditor5-enter/src/shiftenter';
 import CodeBlockCommand from './codeblockcommand';
 
 /**
@@ -19,6 +19,20 @@ import CodeBlockCommand from './codeblockcommand';
  * @extends module:core/plugin~Plugin
  */
 export default class CodeBlockEditing extends Plugin {
+	/**
+	 * @inheritDoc
+	 */
+	static get pluginName() {
+		return 'CodeBlockEditing';
+	}
+
+	/**
+	 * @inheritDoc
+	 */
+	static get requires() {
+		return [ ShiftEnter ];
+	}
+
 	/**
 	 * @inheritDoc
 	 */
@@ -34,7 +48,7 @@ export default class CodeBlockEditing extends Plugin {
 
 		// Disallow codeBlock in codeBlock.
 		schema.addChildCheck( ( context, childDef ) => {
-			if ( context.endsWith( 'codeBlock' ) && childDef.name == 'codeBlock' ) {
+			if ( context.endsWith( 'codeBlock' ) && childDef.name === 'codeBlock' ) {
 				return false;
 			}
 		} );