Преглед изворни кода

Docs: Created editor.config.placeholder documentation.

Aleksander Nowodzinski пре 7 година
родитељ
комит
426109fd75
1 измењених фајлова са 28 додато и 0 уклоњено
  1. 28 0
      packages/ckeditor5-core/src/editor/editorconfig.jsdoc

+ 28 - 0
packages/ckeditor5-core/src/editor/editorconfig.jsdoc

@@ -168,3 +168,31 @@
  *
  * @member {String} module:core/editor/editorconfig~EditorConfig#language
  */
+
+/**
+ * Specifies the text displayed in the editor when there is no content (editor is empty). It is intended to
+ * help users locate the editor in the application (form) and prompt them to input the content. Work similarly
+ * as to the native DOM
+ * [`placeholder` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#The_placeholder_attribute)
+ * used by inputs.
+ *
+ *		const config = {
+ *			placeholder: 'Type some text...'
+ *		};
+ *
+ * The placeholder text is displayed as a pseudo–element of an empty paragraph in the editor content.
+ * The paragraph has the `.ck-placeholder` CSS class and the `data-placeholder` attribute.
+ *
+ *		<p data-placeholder="Type some text..." class="ck-placeholder">
+ *			::before
+ *		</p>
+ *
+ * **Note**: Placeholder text can also be set using the `placeholder` attribute of an element passed to
+ * the `create()` method, for instance to
+ * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
+ *
+ * **Note**: This configuration has precedence over the value of the `placeholder` attribute of a DOM
+ * element passed to the `create()` method.
+ *
+ * @member {String} module:core/editor/editorconfig~EditorConfig#placeholder
+ */