Browse Source

Revert "Internal: Restored locale support for BodyCollection to work correctly."

This reverts commit 8843250a180d048d8672512390632123f4cd5e74.
Marek Lewandowski 5 years ago
parent
commit
c63b460122
2 changed files with 3 additions and 16 deletions
  1. 2 14
      packages/ckeditor5-ui/src/viewcollection.js
  2. 1 2
      packages/ckeditor5-ui/tests/view.js

+ 2 - 14
packages/ckeditor5-ui/src/viewcollection.js

@@ -9,7 +9,6 @@
 
 import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 import Collection from '@ckeditor/ckeditor5-utils/src/collection';
-import Locale from '@ckeditor/ckeditor5-utils/src/locale';
 
 /**
  * Collects {@link module:ui/view~View} instances.
@@ -54,11 +53,8 @@ export default class ViewCollection extends Collection {
 	 *
 	 * @param {Array.<module:ui/view~View>} [initialItems] The initial items of the collection.
 	 */
-	constructor( itemsOrLocale = [] ) {
-		const locale = itemsOrLocale instanceof Locale ? itemsOrLocale : new Locale();
-		const items = itemsOrLocale instanceof Locale ? [] : itemsOrLocale;
-
-		super( items, {
+	constructor( initialItems = [] ) {
+		super( initialItems, {
 			// An #id Number attribute should be legal and not break the `ViewCollection` instance.
 			// https://github.com/ckeditor/ckeditor5-ui/issues/93
 			idProperty: 'viewUid'
@@ -77,14 +73,6 @@ export default class ViewCollection extends Collection {
 		} );
 
 		/**
-		 * The {@link module:core/editor/editor~Editor#locale editor's locale} instance.
-		 * See the view {@link module:ui/view~View#locale locale} property.
-		 *
-		 * @member {module:utils/locale~Locale}
-		 */
-		this.locale = locale;
-
-		/**
 		 * A parent element within which child views are rendered and managed in DOM.
 		 *
 		 * @protected

+ 1 - 2
packages/ckeditor5-ui/tests/view.js

@@ -13,7 +13,6 @@ import Collection from '@ckeditor/ckeditor5-utils/src/collection';
 import ViewCollection from '../src/viewcollection';
 import normalizeHtml from '@ckeditor/ckeditor5-utils/tests/_utils/normalizehtml';
 import { assertCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
-import Locale from '@ckeditor/ckeditor5-utils/src/locale';
 
 let TestView, view, childA, childB;
 
@@ -64,7 +63,7 @@ describe( 'View', () => {
 				const collection = new ViewCollection();
 
 				expect( view.locale ).to.equal( locale );
-				expect( collection.locale ).to.be.an.instanceOf( Locale );
+				expect( collection.locale ).to.be.undefined;
 
 				view._viewCollections.add( collection );
 				expect( collection.locale ).to.equal( view.locale );