MCPcopy
hub / github.com/helloxz/onenav / runModifiers

Function runModifiers

static/bootstrap4/js/bootstrap.bundle.js:2387–2408  ·  view source on GitHub ↗

* Loop trough the list of modifiers and run them in order, * each of them will then edit the data object. * @method * @memberof Popper.Utils * @param {dataObject} data * @param {Array} modifiers * @param {String} ends - Optional modifier name used as stopper * @returns {dataObje

(modifiers, data, ends)

Source from the content-addressed store, hash-verified

2385 * @returns {dataObject}
2386 */
2387 function runModifiers(modifiers, data, ends) {
2388 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
2389
2390 modifiersToRun.forEach(function (modifier) {
2391 if (modifier['function']) {
2392 // eslint-disable-line dot-notation
2393 console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
2394 }
2395 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
2396 if (modifier.enabled && isFunction(fn)) {
2397 // Add properties to offsets to make them a complete clientRect object
2398 // we do this before each modifier to make sure the previous one doesn't
2399 // mess with these values
2400 data.offsets.popper = getClientRect(data.offsets.popper);
2401 data.offsets.reference = getClientRect(data.offsets.reference);
2402
2403 data = fn(data, modifier);
2404 }
2405 });
2406
2407 return data;
2408 }
2409
2410 /**
2411 * Updates the position of the popper, computing the new offsets and applying

Callers 2

updateFunction · 0.85
flipFunction · 0.85

Calls 5

getClientRectFunction · 0.85
findIndexFunction · 0.70
isFunctionFunction · 0.70
fnFunction · 0.50
forEachMethod · 0.45

Tested by

no test coverage detected