浏览代码

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

Piotrek Koszuliński 9 年之前
父节点
当前提交
b78275938d
共有 1 个文件被更改,包括 1 次插入4 次删除
  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 );