Răsfoiți Sursa

Doc fixes and improvements.

Aleksander Nowodzinski 9 ani în urmă
părinte
comite
60d58e2954

+ 8 - 9
packages/ckeditor5-utils/src/dom/position.js

@@ -20,8 +20,7 @@ import getPositionedAncestor from './getpositionedancestor.js';
  * TODO: more docs and example.
  * TODO: more docs and example.
  *
  *
  * @param {module:utils/dom/position~Options} options Positioning options object.
  * @param {module:utils/dom/position~Options} options Positioning options object.
- * @returns {Object} An object containing CSS `top`, `left` coordinates ready to use with `position: absolute` and the `name`
- * of the position.
+ * @returns {module:utils/dom/position~Position}
  */
  */
 export function getOptimalPosition( { element, target, positions, limiter, fitInViewport } ) {
 export function getOptimalPosition( { element, target, positions, limiter, fitInViewport } ) {
 	const positionedElementAncestor = getPositionedAncestor( element.parentElement );
 	const positionedElementAncestor = getPositionedAncestor( element.parentElement );
@@ -177,39 +176,39 @@ function getAbsoluteRectCoordinates( { left, top } ) {
 /**
 /**
  * Element that is to be positioned.
  * Element that is to be positioned.
  *
  *
- * @member {HTMLElement} module:utils/dom/position~Options#element
+ * @member {HTMLElement} #element
  */
  */
 
 
 /**
 /**
  * Target with respect to which the `element` is to be positioned.
  * Target with respect to which the `element` is to be positioned.
  *
  *
- * @member {HTMLElement|Range|ClientRect} module:utils/dom/position~Options#target
+ * @member {HTMLElement|Range|ClientRect} #target
  */
  */
 
 
 /**
 /**
  * An array of functions which return {@link module:utils/dom/position~Position} relative
  * An array of functions which return {@link module:utils/dom/position~Position} relative
  * to the `target`, in the order of preference.
  * to the `target`, in the order of preference.
  *
  *
- * @member {Array.<Function>} module:utils/dom/position~Options#positions
+ * @member {Array.<Function>} #positions
  */
  */
 
 
 /**
 /**
  * When set, the algorithm will chose position which fits the most in the
  * When set, the algorithm will chose position which fits the most in the
  * limiter's bounding rect.
  * limiter's bounding rect.
  *
  *
- * @member {HTMLElement|Range|ClientRect} module:utils/dom/position~Options#limiter
+ * @member {HTMLElement|Range|ClientRect} #limiter
  */
  */
 
 
 /**
 /**
  * When set, the algorithm will chose such a position which fits `element`
  * When set, the algorithm will chose such a position which fits `element`
  * the most inside visible viewport.
  * the most inside visible viewport.
  *
  *
- * @member {Boolean} module:utils/dom/position~Options#fitInViewport
+ * @member {Boolean} #fitInViewport
  */
  */
 
 
 /**
 /**
- * An object describing the position in `position: absolute` coordinate
- * system.
+ * An object describing a position in `position: absolute` coordinate
+ * system, along with position name.
  *
  *
  * @typedef {Object} module:utils/dom/position~Position
  * @typedef {Object} module:utils/dom/position~Position
  *
  *

+ 10 - 10
packages/ckeditor5-utils/src/dom/rect.js

@@ -23,20 +23,20 @@ export default class Rect {
 	/**
 	/**
 	 * Creates an instance of rect.
 	 * Creates an instance of rect.
 	 *
 	 *
-	 * 		// Rect of an HTMLElement.
-	 * 		const rectA = new Rect( document.body );
+	 *		// Rect of an HTMLElement.
+	 *		const rectA = new Rect( document.body );
 	 *
 	 *
-	 * 		// Rect of a DOM Range.
-	 * 		const rectB = new Rect( document.getSelection().getRangeAt( 0 ) );
+	 *		// Rect of a DOM Range.
+	 *		const rectB = new Rect( document.getSelection().getRangeAt( 0 ) );
 	 *
 	 *
-	 * 		// Rect out of an object.
-	 * 		const rectC = new Rect( { top: 0, right: 10, bottom: 10, left: 0, width: 10, height: 10 } );
+	 *		// Rect out of an object.
+	 *		const rectC = new Rect( { top: 0, right: 10, bottom: 10, left: 0, width: 10, height: 10 } );
 	 *
 	 *
-	 * 		// Rect out of another Rect instance.
-	 * 		const rectD = new Rect( rectC );
+	 *		// Rect out of another Rect instance.
+	 *		const rectD = new Rect( rectC );
 	 *
 	 *
-	 *  	// Rect out of a ClientRect.
-	 * 		const rectE = new Rect( document.body.getClientRects().item( 0 ) );
+	 *		// Rect out of a ClientRect.
+	 *		const rectE = new Rect( document.body.getClientRects().item( 0 ) );
 	 *
 	 *
 	 * @param {HTMLElement|Range|ClientRect|module:utils/dom/rect~Rect|Object} obj A source object to create the rect.
 	 * @param {HTMLElement|Range|ClientRect|module:utils/dom/rect~Rect|Object} obj A source object to create the rect.
 	 */
 	 */