瀏覽代碼

Refactoring.

Krzysztof Krztoń 6 年之前
父節點
當前提交
f67133ea3c

+ 3 - 3
packages/ckeditor5-editor-balloon/src/ballooneditorui.js

@@ -68,12 +68,12 @@ export default class BalloonEditorUI extends EditorUI {
 		// Bind to focusTracker instead of editor.editing.view because otherwise
 		// focused editable styles disappear when view#toolbar is focused.
 		view.editable.bind( 'isFocused' ).to( this.focusTracker );
-		editor.editing.view.attachDomRoot( view.editable.editableElement );
+		editor.editing.view.attachDomRoot( view.editable.element );
 		view.editable.name = editingRoot.rootName;
 
-		this._editableElements.push( view.editable );
+		this._editableElements.set( view.editable.name, view.editable.element );
 
-		this.focusTracker.add( view.editable.editableElement );
+		this.focusTracker.add( view.editable.element );
 
 		enableToolbarKeyboardFocus( {
 			origin: editor.editing.view,

+ 0 - 17
packages/ckeditor5-editor-balloon/src/ballooneditoruiview.js

@@ -9,7 +9,6 @@
 
 import EditorUIView from '@ckeditor/ckeditor5-ui/src/editorui/editoruiview';
 import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview';
-import log from '@ckeditor/ckeditor5-utils/src/log';
 
 /**
  * Contextual editor UI view. Uses the {@link module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}.
@@ -44,20 +43,4 @@ export default class BalloonEditorUIView extends EditorUIView {
 
 		this.registerChild( this.editable );
 	}
-
-	/**
-	 * **Deprecated** since `v12.0.0`. The {@link module:ui/editableui/editableuiview~EditableUIView#editableElement
-	 * `EditableUIView editableElement`} could be used instead.
-	 *
-	 * The element which is the main editable element (usually the one with `contentEditable="true"`).
-	 *
-	 * @deprecated v12.0.0 The {@link module:ui/editableui/editableuiview~EditableUIView#editableElement
-	 * `EditableUIView editableElement`} could be used instead.
-	 * @readonly
-	 * @member {HTMLElement} #editableElement
-	 */
-	get editableElement() {
-		log.warn( 'deprecated-ui-view-editableElement: The BalloonEditorUIView#editableElement property is deprecated.' );
-		return this.editable.editableElement;
-	}
 }

+ 0 - 11
packages/ckeditor5-editor-balloon/tests/ballooneditoruiview.js

@@ -8,7 +8,6 @@ import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/i
 import Locale from '@ckeditor/ckeditor5-utils/src/locale';
 
 import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
-import log from '@ckeditor/ckeditor5-utils/src/log';
 
 describe( 'BalloonEditorUIView', () => {
 	let locale, view;
@@ -45,14 +44,4 @@ describe( 'BalloonEditorUIView', () => {
 			sinon.assert.calledOnce( spy );
 		} );
 	} );
-
-	describe( 'editableElement', () => {
-		it( 'returns editable\'s view element', () => {
-			testUtils.sinon.stub( log, 'warn' ).callsFake( () => {} );
-
-			view.render();
-			expect( view.editableElement.getAttribute( 'contentEditable' ) ).to.equal( 'true' );
-			view.destroy();
-		} );
-	} );
 } );