소스 검색

Simplified getEditableElement.

Piotr Jasiun 7 년 전
부모
커밋
444199b161
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      packages/ckeditor5-core/src/editor/editorui.js
  2. 1 1
      packages/ckeditor5-core/tests/editor/editorui.js

+ 2 - 2
packages/ckeditor5-core/src/editor/editorui.js

@@ -107,10 +107,10 @@ export default class EditorUI {
 	 * Returns the editable editor element with the given name or null if editable does not exist.
 	 *
 	 * @param {String} [rootName=main] The editable name.
-	 * @returns {HTMLElement|null}
+	 * @returns {HTMLElement|undefined}
 	 */
 	getEditableElement( rootName = 'main' ) {
-		return this._editableElements.has( rootName ) ? this._editableElements.get( rootName ) : null;
+		return this._editableElements.get( rootName );
 	}
 
 	/**

+ 1 - 1
packages/ckeditor5-core/tests/editor/editorui.js

@@ -121,7 +121,7 @@ describe( 'EditorUI', () => {
 		it( 'should return null if editable with specified name does not exist', () => {
 			const ui = new EditorUI( editor );
 
-			expect( ui.getEditableElement() ).to.null;
+			expect( ui.getEditableElement() ).to.be.undefined;
 		} );
 	} );