Sfoglia il codice sorgente

Removed unnecessary line (state gets changed by the binding) and simplified some code.

Piotrek Koszuliński 9 anni fa
parent
commit
b78275938d
1 ha cambiato i file con 1 aggiunte e 4 eliminazioni
  1. 1 4
      packages/ckeditor5-heading/src/formats.js

+ 1 - 4
packages/ckeditor5-heading/src/formats.js

@@ -46,14 +46,11 @@ export default class Formats extends Feature {
 
 		// Bind dropdown model to command.
 		dropdownModel.bind( 'isEnabled' ).to( command, 'isEnabled' );
-		dropdownModel.bind( 'label' ).to( command, 'format', format => {
-			return format.label;
-		} );
+		dropdownModel.bind( 'label' ).to( command, 'format', format => format.label );
 
 		// Execute command when item from dropdown is selected.
 		this.listenTo( itemListModel, 'execute', ( evt, itemModel ) => {
 			editor.execute( 'format', itemModel.id );
-			dropdownModel.label = itemModel.label;
 		} );
 
 		editor.ui.featureComponents.add( 'formats', ListDropdownController, ListDropdownView, dropdownModel );