Browse Source

Merge branch 't/ckeditor5/416e' into t/ckeditor5/416d

Aleksander Nowodzinski 6 years ago
parent
commit
6cc034eb2d

+ 0 - 5
packages/ckeditor5-editor-decoupled/src/decouplededitorui.js

@@ -115,7 +115,6 @@ export default class DecoupledEditorUI extends EditorUI {
 		const toolbar = view.toolbar;
 
 		toolbar.fillFromConfig( this._toolbarConfig.items, this.componentFactory );
-		toolbar.shouldGroupWhenFull = true;
 
 		enableToolbarKeyboardFocus( {
 			origin: editor.editing.view,
@@ -123,10 +122,6 @@ export default class DecoupledEditorUI extends EditorUI {
 			originKeystrokeHandler: editor.keystrokes,
 			toolbar
 		} );
-
-		this.on( 'update', () => {
-			toolbar.updateGroupedItems();
-		} );
 	}
 
 	/**

+ 3 - 1
packages/ckeditor5-editor-decoupled/src/decouplededitoruiview.js

@@ -40,7 +40,9 @@ export default class DecoupledEditorUIView extends EditorUIView {
 		 * @readonly
 		 * @member {module:ui/toolbar/toolbarview~ToolbarView}
 		 */
-		this.toolbar = new ToolbarView( locale );
+		this.toolbar = new ToolbarView( locale, {
+			shouldGroupWhenFull: true
+		} );
 
 		/**
 		 * The editable of the decoupled editor UI.

+ 0 - 4
packages/ckeditor5-editor-decoupled/tests/decouplededitorui.js

@@ -137,10 +137,6 @@ describe( 'DecoupledEditorUI', () => {
 		} );
 
 		describe( 'view.toolbar', () => {
-			it( 'has automatic items grouping enabled', () => {
-				expect( view.toolbar.shouldGroupWhenFull ).to.be.true;
-			} );
-
 			describe( '#items', () => {
 				it( 'are filled with the config.toolbar (specified as an Array)', () => {
 					return VirtualDecoupledTestEditor

+ 4 - 0
packages/ckeditor5-editor-decoupled/tests/decouplededitoruiview.js

@@ -45,6 +45,10 @@ describe( 'DecoupledEditorUIView', () => {
 			it( 'is not rendered', () => {
 				expect( view.toolbar.isRendered ).to.be.false;
 			} );
+
+			it( 'has automatic items grouping enabled', () => {
+				expect( view.toolbar.options.shouldGroupWhenFull ).to.be.true;
+			} );
 		} );
 
 		describe( '#editable', () => {