浏览代码

Defined idProperty directly in parent class options object.

Aleksander Nowodzinski 9 年之前
父节点
当前提交
e85767e102
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      packages/ckeditor5-ui/src/viewcollection.js

+ 5 - 5
packages/ckeditor5-ui/src/viewcollection.js

@@ -21,7 +21,11 @@ export default class ViewCollection extends Collection {
 	 * @param {utils.Locale} [locale] The {@link core.editor.Editor#locale editor's locale} instance.
 	 */
 	constructor( locale ) {
-		super();
+		super( {
+			// An #id Number attribute should be legal and not break the `ViewCollection` instance.
+			// https://github.com/ckeditor/ckeditor5-ui/issues/93
+			idProperty: 'viewUid'
+		} );
 
 		// Handle {@link ui.View#element} in DOM when a new view is added to the collection.
 		this.on( 'add', ( evt, view, index ) => {
@@ -70,10 +74,6 @@ export default class ViewCollection extends Collection {
 		 * @member {HTMLElement} ui.ViewCollection#_boundItemsToViewsMap
 		 */
 		this._boundItemsToViewsMap = new Map();
-
-		// An #id Number attribute should be legal and not break the `ViewCollection` instance.
-		// https://github.com/ckeditor/ckeditor5-ui/issues/93
-		this._idProperty = 'viewUid';
 	}
 
 	/**