8
0
Просмотр исходного кода

Other: Make highlight dropdown hide after using rubber.

Maciej Gołaszewski 8 лет назад
Родитель
Сommit
bb5e677512
1 измененных файлов с 9 добавлено и 2 удалено
  1. 9 2
      packages/ckeditor5-highlight/src/highlightui.js

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

@@ -61,7 +61,11 @@ export default class HighlightUI extends Plugin {
 				tooltip: true
 				tooltip: true
 			} );
 			} );
 
 
-			this.listenTo( buttonView, 'execute', () => editor.execute( 'highlight' ) );
+			this.listenTo( buttonView, 'execute', () => {
+				// TODO: minor duplication of code
+				editor.execute( 'highlight' );
+				editor.editing.view.focus();
+			} );
 
 
 			return buttonView;
 			return buttonView;
 		} );
 		} );
@@ -120,7 +124,10 @@ export default class HighlightUI extends Plugin {
 			} );
 			} );
 
 
 			// Execute command.
 			// Execute command.
-			this.listenTo( buttonView, 'execute', () => editor.execute( 'highlight', { class: highlighter.class } ) );
+			this.listenTo( buttonView, 'execute', () => {
+				editor.execute( 'highlight', { class: highlighter.class } );
+				editor.editing.view.focus();
+			} );
 
 
 			buttonView.iconView.extendTemplate( {
 			buttonView.iconView.extendTemplate( {
 				attributes: { style: highlighter.type === 'pen' ? { color: highlighter.color } : { backgroundColor: highlighter.color } }
 				attributes: { style: highlighter.type === 'pen' ? { color: highlighter.color } : { backgroundColor: highlighter.color } }