8
0
Эх сурвалжийг харах

Added integration with editing controller.

Piotrek Koszuliński 9 жил өмнө
parent
commit
7c2db10a23

+ 2 - 1
packages/ckeditor5-basic-styles/src/bold.js

@@ -27,7 +27,8 @@ export default class Bold extends Feature {
 			isEnabled: true,
 			isOn: false,
 			label: t( 'Bold' ),
-			icon: 'bold'
+			icon: 'bold',
+			iconAlign: 'LEFT'
 		} );
 
 		// Bind button model to command.

+ 2 - 3
packages/ckeditor5-basic-styles/src/boldengine.js

@@ -18,18 +18,17 @@ export default class BoldEngine extends Feature {
 		const document = editor.document;
 		const schema = document.schema;
 		const data = editor.data;
+		const editing = editor.editing;
 
 		// Schema.
 		schema.allow( { name: '$inline', attributes: [ BOLD ] } );
 
 		// Build converter from model to view for data pipeline.
-		// TODO: Converter for editing pipeline.
-		BuildModelConverterFor( data.modelToView )
+		BuildModelConverterFor( data.modelToView, editing.modelToView )
 			.fromAttribute( BOLD )
 			.toElement( 'strong' );
 
 		// Build converter from view to model for data pipeline.
-		// TODO: Converter for editing pipeline.
 		BuildViewConverterFor( data.viewToModel )
 			.fromElement( 'strong' )
 			.fromElement( 'b' )

+ 2 - 1
packages/ckeditor5-basic-styles/src/italic.js

@@ -27,7 +27,8 @@ export default class Italic extends Feature {
 			isEnabled: true,
 			isOn: false,
 			label: t( 'Italic' ),
-			icon: 'italic'
+			icon: 'italic',
+			iconAlign: 'LEFT'
 		} );
 
 		// Bind button model to command.

+ 2 - 3
packages/ckeditor5-basic-styles/src/italicengine.js

@@ -18,18 +18,17 @@ export default class ItalicEngine extends Feature {
 		const document = editor.document;
 		const schema = document.schema;
 		const data = editor.data;
+		const editing = editor.editing;
 
 		// Schema.
 		schema.allow( { name: '$inline', attributes: [ ITALIC ] } );
 
 		// Build converter from model to view for data pipeline.
-		// TODO: Converter for editing pipeline.
-		BuildModelConverterFor( data.modelToView )
+		BuildModelConverterFor( data.modelToView, editing.modelToView )
 			.fromAttribute( ITALIC )
 			.toElement( 'em' );
 
 		// Build converter from view to model for data pipeline.
-		// TODO: Converter for editing pipeline.
 		BuildViewConverterFor( data.viewToModel )
 			.fromElement( 'em' )
 			.fromElement( 'i' )