浏览代码

Changed: Make ButtonClass as a parameter of `createDropdown()`.

Maciej Gołaszewski 7 年之前
父节点
当前提交
20f6c5758f
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      packages/ckeditor5-highlight/src/highlightui.js

+ 5 - 2
packages/ckeditor5-highlight/src/highlightui.js

@@ -17,7 +17,8 @@ import penIcon from './../theme/icons/pen.svg';
 import eraserIcon from './../theme/icons/eraser.svg';
 
 import ToolbarSeparatorView from '@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview';
-import { createSplitButtonDropdown, addToolbarToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils';
+import SplitButtonView from '@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview';
+import { createDropdown, addToolbarToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils';
 
 import './../theme/highlight.css';
 
@@ -176,7 +177,7 @@ export default class HighlightUI extends Plugin {
 		componentFactory.add( 'highlightDropdown', locale => {
 			const command = editor.commands.get( 'highlight' );
 
-			const dropdownView = createSplitButtonDropdown( locale );
+			const dropdownView = createDropdown( locale, SplitButtonView );
 
 			dropdownView.set( {
 				tooltip: t( 'Highlight' ),
@@ -196,6 +197,8 @@ export default class HighlightUI extends Plugin {
 			dropdownView.bind( 'commandValue' ).to( command, 'value', value => getActiveOption( value, 'model' ) );
 			dropdownView.bind( 'isOn' ).to( command, 'value', value => !!value );
 
+			dropdownView.buttonView.delegate( 'execute' ).to( dropdownView );
+
 			dropdownView.buttonView.extendTemplate( {
 				attributes: {
 					class: 'ck-highlight-button'