浏览代码

Docs fixes.

Szymon Kupś 9 年之前
父节点
当前提交
69c70124b5

+ 2 - 2
packages/ckeditor5-image/src/imagestyle/converters.js

@@ -14,7 +14,7 @@ import { isImage, getStyleByValue } from './utils.js';
  *
  * @param {Object} styles Object containing available styles. See {@link module:image/imagestyle/imagestyleengine~ImageStyleFormat}
  * for more details.
- * @return {Function} Model to view attribute converter.
+ * @returns {Function} Model to view attribute converter.
  */
 export function modelToViewSetStyle( styles ) {
 	return ( evt, data, consumable, conversionApi ) => {
@@ -54,7 +54,7 @@ export function modelToViewSetStyle( styles ) {
  * Returns view to model converter converting image style CSS class to proper value in the model.
  *
  * @param {module:image/imagestyle/imagestyleengine~ImageStyleFormat} style Style for which converter is created.
- * @return {Function} View to model converter.
+ * @returns {Function} View to model converter.
  */
 export function viewToModelImageStyle( style ) {
 	return ( evt, data, consumable, conversionApi ) => {

+ 2 - 2
packages/ckeditor5-image/src/imagestyle/imagestylecommand.js

@@ -34,10 +34,10 @@ export default class ImageStyleCommand extends Command {
 		this.set( 'value', false );
 
 		/**
-		 * Image styles uses by this command.
+		 * Allowed image styles used by this command.
 		 *
 		 * @readonly
-		 * @member {Array.<module:image/imagestyle/imagestyleengine~ImageStyleFormat>} Allowed image styles.
+		 * @member {Array.<module:image/imagestyle/imagestyleengine~ImageStyleFormat>} #styles
 		 */
 		this.styles = styles;
 

+ 14 - 0
packages/ckeditor5-image/src/imagestyle/utils.js

@@ -9,10 +9,24 @@
 
 import ModelElement from '../../engine/model/element.js';
 
+/**
+ * Checks if provided modelElement is an instance of {@link module:engine/model/element~Element Element} and its name
+ * equals to `image`.
+ *
+ * @param {module:engine/model/element~Element} modelElement
+ * @returns {Boolean}
+ */
 export function isImage( modelElement ) {
 	return modelElement instanceof ModelElement && modelElement.name == 'image';
 }
 
+/**
+ * Returns style with given `value` from array of styles.
+ *
+ * @param {String} value
+ * @param {Array.<module:image/imagestyle/imagestyleengine~ImageStyleFormat> } styles
+ * @return {module:image/imagestyle/imagestyleengine~ImageStyleFormat|undefined}
+ */
 export function getStyleByValue( value, styles ) {
 	for ( let style of styles ) {
 		if ( style.value === value ) {