Browse Source

Docs: Updated API docs for image resize.

Added resizeUnit config, changed module of the ResizeImageCommand.
Marek Lewandowski 6 năm trước cách đây
mục cha
commit
1d28e6dad9

+ 23 - 1
packages/ckeditor5-image/src/imageresize.js

@@ -14,7 +14,7 @@ import ImageResizeCommand from './imageresize/imageresizecommand';
 import '../theme/imageresize.css';
 
 /**
- *	Image resize plugin.
+ * The image resize plugin.
  *
  * @extends module:core/plugin~Plugin
  */
@@ -139,3 +139,25 @@ export default class ImageResize extends Plugin {
 			} );
 	}
 }
+
+/**
+ * The available options are `'px'` or `'%'`.
+ *
+ * Determines size unit applied to resized image.
+ *
+ * ```js
+ * ClassicEditor
+ * 	.create( editorElement, {
+ * 		 image: {
+ * 			 resizeUnit: 'px'
+ * 		 }
+ * 	 } )
+ * 	.then( ... )
+ * 	.catch( ... );
+ * ```
+ *
+ * This option is used by {@link }
+ *
+ * @default '%'
+ * @member {String} module:image/image~ImageConfig#resizeUnit
+ */

+ 2 - 2
packages/ckeditor5-image/src/imageresize/imageresizecommand.js

@@ -4,7 +4,7 @@
  */
 
 /**
- * @module image/imagestyle/imageresize
+ * @module image/imageresizecommand
  */
 
 import Command from '@ckeditor/ckeditor5-core/src/command';
@@ -15,7 +15,7 @@ import { isImage } from '../image/utils';
  *
  * @extends module:core/command~Command
  */
-export default class ImageResize extends Command {
+export default class ImageResizeCommand extends Command {
 	/**
 	 * @inheritDoc
 	 */