Ver código fonte

Update documentation for documentColors.

Mateusz Samsel 6 anos atrás
pai
commit
ef574fc03d

+ 36 - 4
packages/ckeditor5-font/src/fontbackgroundcolor.js

@@ -141,7 +141,9 @@ export default class FontBackgroundColor extends Plugin {
  */
 
 /**
- * Represents the number of columns in the dropdown. The default value is:
+ * Represents the number of columns in the dropdown.
+ *
+ * The default value is:
  *
  *		const fontBackgroundColorConfig = {
  *			columns: 5
@@ -151,9 +153,39 @@ export default class FontBackgroundColor extends Plugin {
  */
 
 /**
- * Determines maximum number of available document colors. If not defined,
- * then it equals to {@link module:font/fontbackgroundcolor~FontBackgroundColorConfig#columns} value.
- * If set to `0`, then document colors feature will be disabled.
+ * Determines maximum number of available document colors.
+ * Setting it to `0` will disable document colors feature.
+ *
+ * By default it equals to {@link module:font/fontbackgroundcolor~FontBackgroundColorConfig#columns} value.
+ *
+ * Examples:
+ * ```js
+ * 	// Neither documentColors nor columns are defined in config.
+ * 	// documentColors will equal 5,
+ * 	// because value will be inherited from `columns`,
+ * 	// which has predefined value 5.
+ * 	const fontBackgroundColorConfig = {}
+ * ```
+ * ```js
+ * 	// documentColors will equal 8, because value will be inherited from `columns`.
+ * 	const fontBackgroundColorConfig = {
+ * 		columns: 8
+ * 	}
+ * ```
+ * ```js
+ * 	// documentColors will equal 24, because has defined own value.
+ * 	const fontBackgroundColorConfig = {
+ * 		columns: 8,
+ * 		documentColors: 24
+ * 	}
+ * ```
+ * ```js
+ * 	// documentColors feature will be disabled.
+ * 	const fontBackgroundColorConfig = {
+ * 		columns: 8,
+ * 		documentColors: 0
+ * 	}
+ * ```
  *
  * @member {Number} module:font/fontbackgroundcolor~FontBackgroundColorConfig#documentColors
  */

+ 36 - 4
packages/ckeditor5-font/src/fontcolor.js

@@ -140,7 +140,9 @@ export default class FontColor extends Plugin {
  */
 
 /**
- * Represents the number of columns in the dropdown. The default value is:
+ * Represents the number of columns in the dropdown.
+ *
+ * The default value is:
  *
  *		const fontColorConfig = {
  *			columns: 5
@@ -150,9 +152,39 @@ export default class FontColor extends Plugin {
  */
 
 /**
- * Determines maximum number of available document colors. If not defined,
- * then it equals to {@link module:font/fontcolor~FontColorConfig#columns} value.
- * If set to `0`, then document colors feature will be disabled.
+ * Determines maximum number of available document colors.
+ * Setting it to `0` will disable document colors feature.
+ *
+ * By default it equals to {@link module:font/fontcolor~FontColorConfig#columns} value.
+ *
+ * Examples:
+ * ```js
+ * 	// Neither documentColors nor columns are defined in config.
+ * 	// documentColors will equal 5,
+ * 	// because value will be inherited from `columns`,
+ * 	// which has predefined value 5.
+ * 	const fontColorConfig = {}
+ * ```
+ * ```js
+ * 	// documentColors will equal 8, because value will be inherited from `columns`.
+ * 	const fontColorConfig = {
+ * 		columns: 8
+ * 	}
+ * ```
+ * ```js
+ * 	// documentColors will equal 24, because has defined own value.
+ * 	const fontColorConfig = {
+ * 		columns: 8,
+ * 		documentColors: 24
+ * 	}
+ * ```
+ * ```js
+ * 	// documentColors feature will be disabled.
+ * 	const fontColorConfig = {
+ * 		columns: 8,
+ * 		documentColors: 0
+ * 	}
+ * ```
  *
  * @member {Number} module:font/fontcolor~FontColorConfig#documentColors
  */