MCPcopy
hub / github.com/deepch/RTSPtoWebRTC / runModifiers

Function runModifiers

web/static/js/bootstrap.bundle.js:2375–2396  ·  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

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

Callers 2

updateFunction · 0.85
flipFunction · 0.85

Calls 3

findIndexFunction · 0.85
isFunctionFunction · 0.85
getClientRectFunction · 0.85

Tested by

no test coverage detected