|
@@ -83,6 +83,7 @@ export default class HighlightUI extends Plugin {
|
|
|
_addHighlighterButton( option ) {
|
|
_addHighlighterButton( option ) {
|
|
|
const command = this.editor.commands.get( 'highlight' );
|
|
const command = this.editor.commands.get( 'highlight' );
|
|
|
|
|
|
|
|
|
|
+ // TODO: change naming
|
|
|
this._addButton( 'highlight:' + option.model, option.title, getIconForType( option.type ), option.model, decorateHighlightButton );
|
|
this._addButton( 'highlight:' + option.model, option.title, getIconForType( option.type ), option.model, decorateHighlightButton );
|
|
|
|
|
|
|
|
function decorateHighlightButton( button ) {
|
|
function decorateHighlightButton( button ) {
|
|
@@ -212,6 +213,12 @@ export default class HighlightUI extends Plugin {
|
|
|
}
|
|
}
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
|
|
+ // Execute current action from dropdown's split button action button.
|
|
|
|
|
+ dropdownView.buttonView.on( 'execute', () => {
|
|
|
|
|
+ editor.execute( 'highlight', { value: model.commandValue } );
|
|
|
|
|
+ editor.editing.view.focus();
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
// Returns active highlighter option depending on current command value.
|
|
// Returns active highlighter option depending on current command value.
|
|
|
// If current is not set or it is the same as last execute this method will return the option key (like icon or color)
|
|
// If current is not set or it is the same as last execute this method will return the option key (like icon or color)
|
|
|
// of last executed highlighter. Otherwise it will return option key for current one.
|
|
// of last executed highlighter. Otherwise it will return option key for current one.
|