Przeglądaj źródła

Aligned the HeadingUI to the latest ListItemView architecture.

Aleksander Nowodzinski 7 lat temu
rodzic
commit
26e53985e3
1 zmienionych plików z 4 dodań i 3 usunięć
  1. 4 3
      packages/ckeditor5-heading/src/headingui.js

+ 4 - 3
packages/ckeditor5-heading/src/headingui.js

@@ -46,15 +46,16 @@ export default class HeadingUI extends Plugin {
 			for ( const option of options ) {
 				const itemModel = new Model( {
 					label: option.title,
-					class: option.class
+					class: option.class,
+					withText: true
 				} );
 
 				if ( option.model === 'paragraph' ) {
-					itemModel.bind( 'isActive' ).to( paragraphCommand, 'value' );
+					itemModel.bind( 'isOn' ).to( paragraphCommand, 'value' );
 					itemModel.set( 'commandName', 'paragraph' );
 					commands.push( paragraphCommand );
 				} else {
-					itemModel.bind( 'isActive' ).to( headingCommand, 'value', value => value === option.model );
+					itemModel.bind( 'isOn' ).to( headingCommand, 'value', value => value === option.model );
 					itemModel.set( {
 						commandName: 'heading',
 						commandValue: option.model