MCPcopy Create free account
hub / github.com/docker/getting-started / applyStyle

Function applyStyle

app/src/static/js/react-bootstrap.js:4152–4167  ·  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 to popp

(data)

Source from the content-addressed store, hash-verified

4150
4151
4152function applyStyle(data) {
4153 // any property present in `data.styles` will be applied to the popper,
4154 // in this way we can make the 3rd party modifiers add custom styles to it
4155 // Be aware, modifiers could override the properties defined in the previous
4156 // lines of this modifier!
4157 setStyles(data.instance.popper, data.styles); // any property present in `data.attributes` will be applied to the popper,
4158 // they will be set as HTML attributes of the element
4159
4160 setAttributes(data.instance.popper, data.attributes); // if arrowElement is defined and arrowStyles has some properties
4161
4162 if (data.arrowElement && Object.keys(data.arrowStyles).length) {
4163 setStyles(data.arrowElement, data.arrowStyles);
4164 }
4165
4166 return data;
4167}
4168/**
4169 * Set the x-placement attribute before everything else because it could be used
4170 * to add margins to the popper margins needs to be calculated to get the

Callers

nothing calls this directly

Calls 2

setStylesFunction · 0.85
setAttributesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…