MCPcopy Index your code
hub / github.com/docker/getting-started / applyStyleOnLoad

Function applyStyleOnLoad

app/src/static/js/react-bootstrap.js:4180–4194  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

4178
4179
4180function 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

Callers

nothing calls this directly

Calls 3

getReferenceOffsetsFunction · 0.85
computeAutoPlacementFunction · 0.85
setStylesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…