MCPcopy Index your code
hub / github.com/deepch/RTSPtoWebRTC / hide

Function hide

web/static/js/bootstrap.bundle.js:3450–3479  ·  view source on GitHub ↗

* @function * @memberof Modifiers * @argument {Object} data - The data object generated by update method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified

(data)

Source from the content-addressed store, hash-verified

3448 * @returns {Object} The data object, properly modified
3449 */
3450 function hide(data) {
3451 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
3452 return data;
3453 }
3454
3455 var refRect = data.offsets.reference;
3456 var bound = find(data.instance.modifiers, function (modifier) {
3457 return modifier.name === 'preventOverflow';
3458 }).boundaries;
3459
3460 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
3461 // Avoid unnecessary DOM access if visibility hasn't changed
3462 if (data.hide === true) {
3463 return data;
3464 }
3465
3466 data.hide = true;
3467 data.attributes['x-out-of-boundaries'] = '';
3468 } else {
3469 // Avoid unnecessary DOM access if visibility hasn't changed
3470 if (data.hide === false) {
3471 return data;
3472 }
3473
3474 data.hide = false;
3475 data.attributes['x-out-of-boundaries'] = false;
3476 }
3477
3478 return data;
3479 }
3480
3481 /**
3482 * @function

Callers

nothing calls this directly

Calls 2

isModifierRequiredFunction · 0.85
findFunction · 0.85

Tested by

no test coverage detected