8
0
Просмотр исходного кода

Changed hide to detach method name in ImageBalloonPanel.

Szymon Kupś 9 лет назад
Родитель
Сommit
dab187b494

+ 1 - 0
packages/ckeditor5-image/src/image.js

@@ -39,6 +39,7 @@ export default class Image extends Plugin {
 	 * @inheritDoc
 	 */
 	init() {
+		// TODO: this returns promise too.
 		this._createAlternateTextChangeButton();
 
 		return this._createAlternateTextBalloonPanel();

+ 4 - 4
packages/ckeditor5-image/src/ui/imageballoonpanel.js

@@ -68,7 +68,7 @@ export default class ImageBalloonPanel extends BalloonPanelView {
 			const selectedElement = editingView.selection.getSelectedElement();
 
 			if ( !selectedElement || !isImageWidget( selectedElement ) ) {
-				this.hide();
+				this.detach();
 			}
 		}, { priority: 'low' } );
 
@@ -78,15 +78,15 @@ export default class ImageBalloonPanel extends BalloonPanelView {
 	}
 
 	attach() {
-		super.show();
+		this.show();
 
 		this._attach();
 		this.editor.ui.view.listenTo( global.window, 'scroll', this._throttledAttach );
 		this.editor.ui.view.listenTo( global.window, 'resize', this._throttledAttach );
 	}
 
-	hide() {
-		super.hide();
+	detach() {
+		this.hide();
 
 		this.editor.ui.view.stopListening( global.window, 'scroll', this._throttledAttach );
 		this.editor.ui.view.stopListening( global.window, 'resize', this._throttledAttach );