Kaynağa Gözat

Made the ImageStyleEngine use the object-center and object-full-width icons in different cases.

Aleksander Nowodzinski 8 yıl önce
ebeveyn
işleme
5f1dce85a0

+ 6 - 4
packages/ckeditor5-image/src/imagestyle/imagestyleengine.js

@@ -13,6 +13,7 @@ import ImageEngine from '../image/imageengine';
 import { viewToModelStyleAttribute, modelToViewStyleAttribute } from './converters';
 import { viewToModelStyleAttribute, modelToViewStyleAttribute } from './converters';
 import log from '@ckeditor/ckeditor5-utils/src/log';
 import log from '@ckeditor/ckeditor5-utils/src/log';
 
 
+import fullWidthIcon from '@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg';
 import leftIcon from '@ckeditor/ckeditor5-core/theme/icons/object-left.svg';
 import leftIcon from '@ckeditor/ckeditor5-core/theme/icons/object-left.svg';
 import centerIcon from '@ckeditor/ckeditor5-core/theme/icons/object-center.svg';
 import centerIcon from '@ckeditor/ckeditor5-core/theme/icons/object-center.svg';
 import rightIcon from '@ckeditor/ckeditor5-core/theme/icons/object-right.svg';
 import rightIcon from '@ckeditor/ckeditor5-core/theme/icons/object-right.svg';
@@ -155,7 +156,7 @@ ImageStyleEngine.defaultStyles = {
 	imageStyleFull: {
 	imageStyleFull: {
 		name: 'imageStyleFull',
 		name: 'imageStyleFull',
 		title: 'Full size image',
 		title: 'Full size image',
-		icon: centerIcon,
+		icon: fullWidthIcon,
 		value: null
 		value: null
 	},
 	},
 
 
@@ -200,11 +201,12 @@ ImageStyleEngine.defaultStyles = {
  * Default image style icons provided by the plugin, which can be referred in the
  * Default image style icons provided by the plugin, which can be referred in the
  * {@link module:image/image~ImageConfig#styles} config.
  * {@link module:image/image~ImageConfig#styles} config.
  *
  *
- * There are 3 icons available: `'left'`, `'center'` and `'right'`.
+ * There are 3 icons available: `'full'`, `'left'`, `'center'` and `'right'`.
  *
  *
  * @member {Object.<String, String>}
  * @member {Object.<String, String>}
  */
  */
 ImageStyleEngine.defaultIcons = {
 ImageStyleEngine.defaultIcons = {
+	full: fullWidthIcon,
 	left: leftIcon,
 	left: leftIcon,
 	right: rightIcon,
 	right: rightIcon,
 	center: centerIcon,
 	center: centerIcon,
@@ -269,12 +271,12 @@ function normalizeStyle( style ) {
 /**
 /**
  * Image style format descriptor.
  * Image style format descriptor.
  *
  *
- *		import fullIcon from 'path/to/icon.svg`;
+ *		import fullWidthIcon from 'path/to/icon.svg`;
  *
  *
  *		const imageStyleFormat = {
  *		const imageStyleFormat = {
  *			name: 'fullSizeImage',
  *			name: 'fullSizeImage',
  *			value: 'full',
  *			value: 'full',
- *			icon: fullIcon,
+ *			icon: fullWidthIcon,
  *			title: 'Full size image',
  *			title: 'Full size image',
  *			class: 'image-full-size'
  *			class: 'image-full-size'
  *		}
  *		}