Forráskód Böngészése

Docs: Added and fixed docs.

Szymon Cofalik 8 éve
szülő
commit
de5a0f3158

+ 5 - 0
packages/ckeditor5-engine/src/view/node.js

@@ -182,6 +182,11 @@ export default class Node {
 		}
 		}
 	}
 	}
 
 
+	/**
+	 * Custom toJSON method to solve child-parent circular dependencies.
+	 *
+	 * @returns {Object} Clone of this object with the parent property removed.
+	 */
 	toJSON() {
 	toJSON() {
 		const json = clone( this );
 		const json = clone( this );
 
 

+ 6 - 3
packages/ckeditor5-engine/src/view/uielement.js

@@ -84,10 +84,13 @@ export default class UIElement extends Element {
 }
 }
 
 
 /**
 /**
- * Assign key observer which will move cursor over a ui element if right arrow key is pressed and selection is before
- * ui element.
+ * This function injects UI element handling to the given {@link module:engine/view/document~Document document}.
  *
  *
- * @param {module:engine/view/document~Document} document Document instance we should inject quirks handling on.
+ * A callback is added to {@link module:engine/view/document~Document#event:keydown document keydown event}.
+ * The callback handles the situation when right arrow key is pressed and selection is collapsed before a UI element.
+ * Without this handler, it would be impossible to "jump over" UI element using right arrow key.
+ *
+ * @param {module:engine/view/document~Document} document Document to which the quirks handling will be injected.
  */
  */
 export function injectUiElementHandling( document ) {
 export function injectUiElementHandling( document ) {
 	document.on( 'keydown', ( evt, data ) => jumpOverUiElement( evt, data, document.domConverter ) );
 	document.on( 'keydown', ( evt, data ) => jumpOverUiElement( evt, data, document.domConverter ) );