Explorar el Código

Merge branch 'master' into t/ckeditor5/494

Aleksander Nowodzinski hace 7 años
padre
commit
d3dee0724c

+ 1 - 1
packages/ckeditor5-heading/docs/_snippets/features/custom-heading-elements.js

@@ -5,7 +5,7 @@
 
 /* globals ClassicEditor, console, window, document */
 
-import { CS_CONFIG } from '@ckeditor/ckeditor5-cloudservices/tests/_utils/cloudservices-config';
+import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
 
 ClassicEditor
 	.create( document.querySelector( '#snippet-custom-heading-elements' ), {

+ 1 - 1
packages/ckeditor5-heading/docs/_snippets/features/custom-heading-levels.js

@@ -5,7 +5,7 @@
 
 /* globals ClassicEditor, console, window, document */
 
-import { CS_CONFIG } from '@ckeditor/ckeditor5-cloudservices/tests/_utils/cloudservices-config';
+import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
 
 ClassicEditor
 	.create( document.querySelector( '#snippet-custom-heading-levels' ), {

+ 2 - 2
packages/ckeditor5-heading/package.json

@@ -15,7 +15,7 @@
     "@ckeditor/ckeditor5-theme-lark": "^1.0.0-beta.1"
   },
   "devDependencies": {
-    "@ckeditor/ckeditor5-cloudservices": "^1.0.0-beta.1",
+    "@ckeditor/ckeditor5-cloud-services": "^1.0.0-beta.1",
     "@ckeditor/ckeditor5-editor-classic": "^1.0.0-beta.1",
     "@ckeditor/ckeditor5-enter": "^1.0.0-beta.1",
     "@ckeditor/ckeditor5-image": "^1.0.0-beta.1",
@@ -24,7 +24,7 @@
     "eslint": "^4.15.0",
     "eslint-config-ckeditor5": "^1.0.7",
     "husky": "^0.14.3",
-    "lint-staged": "^6.0.0"
+    "lint-staged": "^7.0.0"
   },
   "engines": {
     "node": ">=6.0.0",

+ 1 - 5
packages/ckeditor5-heading/src/headingcommand.js

@@ -63,16 +63,12 @@ export default class HeadingCommand extends Command {
 	 * @param {String} options.value Name of the element which this command will apply in the model.
 	 * @fires execute
 	 */
-	execute( options = {} ) {
+	execute( options ) {
 		const model = this.editor.model;
 		const document = model.document;
 
 		const modelElement = options.value;
 
-		if ( !this.modelElements.includes( modelElement ) ) {
-			return;
-		}
-
 		model.change( writer => {
 			const blocks = Array.from( document.selection.getSelectedBlocks() )
 				.filter( block => {

+ 2 - 10
packages/ckeditor5-heading/tests/headingcommand.js

@@ -174,17 +174,9 @@ describe( 'HeadingCommand', () => {
 			} );
 		} );
 
-		it( 'should do nothing on non-registered model elements', () => {
+		it( 'should do nothing with non-registered model elements', () => {
 			setData( model, '<heading1>[]</heading1>' );
-			command.execute( { value: 'paragraph' } );
-
-			expect( getData( model ) ).to.equal( '<heading1>[]</heading1>' );
-			expect( command.value ).to.equal( 'heading1' );
-		} );
-
-		it( 'should do nothing when empty value is passed', () => {
-			setData( model, '<heading1>[]</heading1>' );
-			command.execute();
+			command.execute( { value: 'heading5' } );
 
 			expect( getData( model ) ).to.equal( '<heading1>[]</heading1>' );
 			expect( command.value ).to.equal( 'heading1' );