Browse Source

Docs: view#render and view.document#postFixer use cases. [skip ci]

Piotr Jasiun 7 years ago
parent
commit
2aa3ad800b

+ 4 - 0
packages/ckeditor5-engine/src/view/document.js

@@ -96,6 +96,10 @@ export default class Document {
 	 * a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should
 	 * not be fixed in the new document tree state.
 	 *
+	 * View post-fixers are useful when you wants to update view structure whenever it changes, for instance add some classes
+	 * to elements based on the view structure or selection. However, is you need DOM elements to be already updated, use
+	 * {@link module:engine/view/view~View#event:render render event}.
+	 *
 	 * As a parameter, a post-fixer callback receives a {@link module:engine/view/writer~Writer writer} instance connected with the
 	 * executed changes block.
 	 *

+ 4 - 0
packages/ckeditor5-engine/src/view/view.js

@@ -400,6 +400,10 @@ export default class View {
 	 *			// Rendering to the DOM is complete.
 	 *		} );
 	 *
+	 * This event is useful when you want to update interface elements after the rendering, e.g. position of the
+	 * balloon panel. If you wants to change view structure use
+	 * {@link module:engine/view/document~Document#registerPostFixer post fixers}.
+	 *
 	 * @event module:engine/view/view~View#event:render
 	 */
 }