Browse Source

Renamed detachFromDOM() to detachFromDom().

Oskar Wróbel 6 years ago
parent
commit
b9aeb9877c

+ 2 - 2
packages/ckeditor5-ui/src/editorui/bodycollection.js

@@ -27,7 +27,7 @@ import createElement from '@ckeditor/ckeditor5-utils/src/dom/createelement';
  * Body collection will render itself automatically in the DOM body element as soon as you call {@link ~BodyCollection#attachToDom}.
  * If you create multiple body collections this class will create a special wrapper element in the DOM to limit the number of
  * elements created directly in the body and remove it when the last body collection will be
- * {@link ~BodyCollection#detachFromDOM detached}.
+ * {@link ~BodyCollection#detachFromDom detached}.
  *
  * @extends module:ui/viewcollection~ViewCollection
  */
@@ -71,7 +71,7 @@ export default class BodyCollection extends ViewCollection {
 	 * Detach the collection from the DOM structure. Use this method when you do not need to use the body collection
 	 * anymore to clean-up the DOM structure.
 	 */
-	detachFromDOM() {
+	detachFromDom() {
 		super.destroy();
 
 		if ( this._bodyCollectionContainer ) {

+ 1 - 1
packages/ckeditor5-ui/src/editorui/editoruiview.js

@@ -49,7 +49,7 @@ export default class EditorUIView extends View {
 	 * @inheritDoc
 	 */
 	destroy() {
-		this.body.detachFromDOM();
+		this.body.detachFromDom();
 
 		return super.destroy();
 	}

+ 7 - 7
packages/ckeditor5-ui/tests/editorui/bodycollection.js

@@ -133,12 +133,12 @@ describe( 'BodyCollection', () => {
 		} );
 	} );
 
-	describe( 'detachFromDOM', () => {
+	describe( 'detachFromDom', () => {
 		it( 'removes the body collection from DOM', () => {
 			const body = new BodyCollection( locale );
 
 			body.attachToDom();
-			body.detachFromDOM();
+			body.detachFromDom();
 
 			expect( document.querySelectorAll( '.ck-body-wrapper' ).length ).to.equal( 0 );
 			expect( document.querySelectorAll( '.ck-body' ).length ).to.equal( 0 );
@@ -154,12 +154,12 @@ describe( 'BodyCollection', () => {
 			expect( document.querySelectorAll( '.ck-body-wrapper' ).length ).to.equal( 1 );
 			expect( document.querySelectorAll( '.ck-body' ).length ).to.equal( 2 );
 
-			body1.detachFromDOM();
+			body1.detachFromDom();
 
 			expect( document.querySelectorAll( '.ck-body-wrapper' ).length ).to.equal( 1 );
 			expect( document.querySelectorAll( '.ck-body' ).length ).to.equal( 1 );
 
-			body2.detachFromDOM();
+			body2.detachFromDom();
 
 			expect( document.querySelectorAll( '.ck-body-wrapper' ).length ).to.equal( 0 );
 			expect( document.querySelectorAll( '.ck-body' ).length ).to.equal( 0 );
@@ -170,8 +170,8 @@ describe( 'BodyCollection', () => {
 			body.attachToDom();
 
 			expect( () => {
-				body.detachFromDOM();
-				body.detachFromDOM();
+				body.detachFromDom();
+				body.detachFromDom();
 			} ).to.not.throw();
 		} );
 
@@ -179,7 +179,7 @@ describe( 'BodyCollection', () => {
 			const body = new BodyCollection( locale );
 
 			expect( () => {
-				body.detachFromDOM();
+				body.detachFromDom();
 			} ).to.not.throw();
 		} );
 	} );