Selaa lähdekoodia

Add vertical alignment support.

Maciej Gołaszewski 6 vuotta sitten
vanhempi
sitoutus
31e237df47

+ 3 - 2
packages/ckeditor5-table/src/tableediting.js

@@ -113,15 +113,16 @@ export default class TableEditing extends Plugin {
 
 		// Table styles:
 		schema.extend( 'tableCell', {
-			allowAttributes: [ 'border', 'background-color', 'padding' ]
+			allowAttributes: [ 'border', 'background-color', 'padding', 'vertical-align' ]
 		} );
 		schema.extend( 'table', {
-			allowAttributes: [ 'border', 'background-color', 'padding' ]
+			allowAttributes: [ 'border', 'background-color', 'padding', 'vertical-align' ]
 		} );
 
 		setupConversion( conversion, 'border' );
 		setupConversion( conversion, 'background-color' );
 		setupConversion( conversion, 'padding' );
+		setupConversion( conversion, 'vertical-align' );
 
 		// Define all the commands.
 		editor.commands.add( 'insertTable', new InsertTableCommand( editor ) );

+ 4 - 1
packages/ckeditor5-table/tests/manual/tablestyles.js

@@ -7,6 +7,9 @@
 
 import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
 import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
+import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment';
+import IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock';
+import Indent from '@ckeditor/ckeditor5-indent/src/indent';
 
 const sourceElement = document.querySelector( '#editor' );
 const clonedSource = sourceElement.cloneNode( true );
@@ -15,7 +18,7 @@ document.querySelector( '#cloned-source' ).append( ...clonedSource.childNodes );
 
 ClassicEditor
 	.create( sourceElement, {
-		plugins: [ ArticlePluginSet ],
+		plugins: [ ArticlePluginSet, Alignment, Indent, IndentBlock ],
 		toolbar: [
 			'heading', '|', 'insertTable', '|', 'bold', 'italic', 'bulletedList', 'numberedList', 'blockQuote', 'undo', 'redo'
 		],