Explorar el Código

Internal: Restored _getItemIdBeforeAdding name. It actually should be used in add method too so it will make more sense.

Marek Lewandowski hace 5 años
padre
commit
0703ce21ad
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      packages/ckeditor5-utils/src/collection.js

+ 2 - 2
packages/ckeditor5-utils/src/collection.js

@@ -128,7 +128,7 @@ export default class Collection {
 		if ( hasInitialItems ) {
 			for ( const item of initialItemsOrOptions ) {
 				this._items.push( item );
-				this._itemMap.set( this._getItemId( item ), item );
+				this._itemMap.set( this._getItemIdBeforeAdding( item ), item );
 			}
 		}
 
@@ -657,7 +657,7 @@ export default class Collection {
 	 * @param {Object} item Item to be added.
 	 * @returns {String}
 	 */
-	_getItemId( item ) {
+	_getItemIdBeforeAdding( item ) {
 		const idProperty = this._idProperty;
 		let itemId;