Ver código fonte

Renamed expandToolbarConfig->getItemsFromConfig.

Aleksander Nowodzinski 8 anos atrás
pai
commit
1c5a0b9a16

+ 1 - 1
packages/ckeditor5-ui/src/toolbar/utils.js

@@ -17,7 +17,7 @@
  * @param {module:ui/componentfactory~ComponentFactory} factory A factory producing toolbar items.
  * @returns {Promise} A promise resolved when all toolbar items are initialized.
  */
-export function expandToolbarConfig( config, collection, factory ) {
+export function getItemsFromConfig( config, collection, factory ) {
 	let promises = [];
 
 	if ( config ) {

+ 4 - 4
packages/ckeditor5-ui/tests/toolbar/utils.js

@@ -14,12 +14,12 @@ import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
 import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler';
 import { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard';
 import {
-	expandToolbarConfig,
+	getItemsFromConfig,
 	enableToolbarKeyboardFocus
 } from '../../src/toolbar/utils';
 
 describe( 'utils', () => {
-	describe( 'expandToolbarConfig()', () => {
+	describe( 'getItemsFromConfig()', () => {
 		let factory;
 
 		beforeEach( () => {
@@ -30,13 +30,13 @@ describe( 'utils', () => {
 		} );
 
 		it( 'returns a promise', () => {
-			expect( expandToolbarConfig() ).to.be.instanceOf( Promise );
+			expect( getItemsFromConfig() ).to.be.instanceOf( Promise );
 		} );
 
 		it( 'expands the config into collection', () => {
 			const collection = new Collection();
 
-			return expandToolbarConfig( [ 'foo', 'bar', 'foo' ], collection, factory )
+			return getItemsFromConfig( [ 'foo', 'bar', 'foo' ], collection, factory )
 				.then( () => {
 					expect( collection ).to.have.length( 3 );
 					expect( collection.get( 0 ).name ).to.equal( 'foo' );