Procházet zdrojové kódy

Simplified getEditableElement.

Piotr Jasiun před 7 roky
rodič
revize
444199b161

+ 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;
 		} );
 	} );