MCPcopy Create free account
hub / github.com/deepch/RTSPtoWebRTC / applyStyle

Function applyStyle

web/static/js/bootstrap.bundle.js:2664–2681  ·  view source on GitHub ↗

* @function * @memberof Modifiers * @argument {Object} data - The data object generated by `update` method * @argument {Object} data.styles - List of style properties - values to apply to popper element * @argument {Object} data.attributes - List of attribute properties - values to apply

(data)

Source from the content-addressed store, hash-verified

2662 * @returns {Object} The same data object
2663 */
2664 function applyStyle(data) {
2665 // any property present in `data.styles` will be applied to the popper,
2666 // in this way we can make the 3rd party modifiers add custom styles to it
2667 // Be aware, modifiers could override the properties defined in the previous
2668 // lines of this modifier!
2669 setStyles(data.instance.popper, data.styles);
2670
2671 // any property present in `data.attributes` will be applied to the popper,
2672 // they will be set as HTML attributes of the element
2673 setAttributes(data.instance.popper, data.attributes);
2674
2675 // if arrowElement is defined and arrowStyles has some properties
2676 if (data.arrowElement && Object.keys(data.arrowStyles).length) {
2677 setStyles(data.arrowElement, data.arrowStyles);
2678 }
2679
2680 return data;
2681 }
2682
2683 /**
2684 * Set the x-placement attribute before everything else because it could be used

Callers

nothing calls this directly

Calls 2

setStylesFunction · 0.85
setAttributesFunction · 0.85

Tested by

no test coverage detected