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

Function setStyles

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

* Set the style to the given popper * @method * @memberof Popper.Utils * @argument {Element} element - Element to apply the style to * @argument {Object} styles * Object with a list of properties and values which will be applied to the element

(element, styles)

Source from the content-addressed store, hash-verified

4107
4108
4109function setStyles(element, styles) {
4110 Object.keys(styles).forEach(function (prop) {
4111 var unit = ''; // add unit if the value is numeric and is one of the following
4112
4113 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
4114 unit = 'px';
4115 }
4116
4117 element.style[prop] = styles[prop] + unit;
4118 });
4119}
4120/**
4121 * Set the attributes to the given popper
4122 * @method

Callers 2

applyStyleFunction · 0.85
applyStyleOnLoadFunction · 0.85

Calls 1

isNumericFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…