A positioning function which, based on positioned element and target module:utils/dom/rect~Rect Rects, returns rect coordinates
representing the geometrical relation between them. Used by the module:utils/dom/position~getOptimalPosition helper.
// This simple position will place the element directly under the target, in the middle: // // [ Target ] // +-----------------+ // | Element | // +-----------------+ // constposition = ( targetRect, elementRect, [ viewportRect ] ) => ( { top:targetRect.bottom, left:targetRect.left + targetRect.width / 2 - elementRect.width / 2, name:'bottomMiddle',
// Note: The config is optional. config: { zIndex:'999' } } );
A positioning function which, based on positioned element and target module:utils/dom/rect~Rect Rects, returns rect coordinates representing the geometrical relation between them. Used by the module:utils/dom/position~getOptimalPosition helper.