* Set the x-placement attribute before everything else because it could be used * to add margins to the popper margins needs to be calculated to get the * correct popper offsets. * @method * @memberof Popper.modifiers * @param {HTMLElement} reference - The reference element used to position the
(reference, popper, options, modifierOptions, state)
| 4178 | |
| 4179 | |
| 4180 | function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { |
| 4181 | // compute reference element offsets |
| 4182 | var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); // compute auto placement, store placement inside the data object, |
| 4183 | // modifiers will be able to edit `placement` if needed |
| 4184 | // and refer to originalPlacement to know the original value |
| 4185 | |
| 4186 | var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); |
| 4187 | popper.setAttribute('x-placement', placement); // Apply `position` to popper before anything else because |
| 4188 | // without the position applied we can't guarantee correct computations |
| 4189 | |
| 4190 | setStyles(popper, { |
| 4191 | position: options.positionFixed ? 'fixed' : 'absolute' |
| 4192 | }); |
| 4193 | return options; |
| 4194 | } |
| 4195 | /** |
| 4196 | * @function |
| 4197 | * @memberof Popper.Utils |
nothing calls this directly
no test coverage detected
searching dependent graphs…