MCPcopy Create free account
hub / github.com/feiyu563/PrometheusAlert / setStyles

Function setStyles

static/plugins/bootstrap/js/bootstrap.bundle.js:2637–2646  ·  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

2635 * Object with a list of properties and values which will be applied to the element
2636 */
2637 function setStyles(element, styles) {
2638 Object.keys(styles).forEach(function (prop) {
2639 var unit = '';
2640 // add unit if the value is numeric and is one of the following
2641 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
2642 unit = 'px';
2643 }
2644 element.style[prop] = styles[prop] + unit;
2645 });
2646 }
2647
2648 /**
2649 * Set the attributes to the given popper

Callers 2

applyStyleFunction · 0.85
applyStyleOnLoadFunction · 0.85

Calls 1

isNumericFunction · 0.85

Tested by

no test coverage detected