浏览代码

Updated ImageToolbar docs.

Szymon Kupś 9 年之前
父节点
当前提交
f1f7564e55
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      packages/ckeditor5-image/src/imagetoolbar.js

+ 7 - 1
packages/ckeditor5-image/src/imagetoolbar.js

@@ -12,6 +12,7 @@ import Plugin from 'ckeditor5-core/src/plugin';
 import ToolbarView from 'ckeditor5-ui/src/toolbar/toolbarview';
 import ToolbarView from 'ckeditor5-ui/src/toolbar/toolbarview';
 import { isImageWidget } from './utils';
 import { isImageWidget } from './utils';
 import ImageBalloonPanel from './ui/imageballoonpanel';
 import ImageBalloonPanel from './ui/imageballoonpanel';
+
 /**
 /**
  * Image toolbar class. Creates image toolbar placed inside balloon panel that is showed when image widget is selected.
  * Image toolbar class. Creates image toolbar placed inside balloon panel that is showed when image widget is selected.
  * Toolbar components are created using editor's {@link module:ui/componentfactory~ComponentFactory ComponentFactory}
  * Toolbar components are created using editor's {@link module:ui/componentfactory~ComponentFactory ComponentFactory}
@@ -82,8 +83,10 @@ export default class ImageToolbar extends Plugin {
 		return Promise.all( promises );
 		return Promise.all( promises );
 	}
 	}
 
 
+	/**
+	 * Shows the toolbar.
+	 */
 	show() {
 	show() {
-		// TODO: maybe isImageWidgetSelected( editor ) - this code is repeated in many places.
 		const selectedElement = this.editor.editing.view.selection.getSelectedElement();
 		const selectedElement = this.editor.editing.view.selection.getSelectedElement();
 
 
 		if ( selectedElement && isImageWidget( selectedElement ) ) {
 		if ( selectedElement && isImageWidget( selectedElement ) ) {
@@ -91,6 +94,9 @@ export default class ImageToolbar extends Plugin {
 		}
 		}
 	}
 	}
 
 
+	/**
+	 * Hides the toolbar.
+	 */
 	hide() {
 	hide() {
 		this._panel.detach();
 		this._panel.detach();
 	}
 	}