MCPcopy
hub / github.com/deepch/RTSPtoWebRTC / update

Function update

web/static/js/bootstrap.bundle.js:2405–2449  ·  view source on GitHub ↗

* Updates the position of the popper, computing the new offsets and applying * the new style. * Prefer `scheduleUpdate` over `update` because of performance reasons. * @method * @memberof Popper

()

Source from the content-addressed store, hash-verified

2403 * @memberof Popper
2404 */
2405 function update() {
2406 // if popper is destroyed, don't perform any further update
2407 if (this.state.isDestroyed) {
2408 return;
2409 }
2410
2411 var data = {
2412 instance: this,
2413 styles: {},
2414 arrowStyles: {},
2415 attributes: {},
2416 flipped: false,
2417 offsets: {}
2418 };
2419
2420 // compute reference element offsets
2421 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
2422
2423 // compute auto placement, store placement inside the data object,
2424 // modifiers will be able to edit `placement` if needed
2425 // and refer to originalPlacement to know the original value
2426 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
2427
2428 // store the computed placement inside `originalPlacement`
2429 data.originalPlacement = data.placement;
2430
2431 data.positionFixed = this.options.positionFixed;
2432
2433 // compute the popper offsets
2434 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
2435
2436 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
2437
2438 // run the modifiers
2439 data = runModifiers(this.modifiers, data);
2440
2441 // the first `update` will call `onCreate` callback
2442 // the other ones will call `onUpdate` callback
2443 if (!this.state.isCreated) {
2444 this.state.isCreated = true;
2445 this.options.onCreate(data);
2446 } else {
2447 this.options.onUpdate(data);
2448 }
2449 }
2450
2451 /**
2452 * Helper used to know if the given modifier is enabled.

Callers

nothing calls this directly

Calls 4

getReferenceOffsetsFunction · 0.85
computeAutoPlacementFunction · 0.85
getPopperOffsetsFunction · 0.85
runModifiersFunction · 0.85

Tested by

no test coverage detected