MCPcopy Index your code
hub / github.com/docker/getting-started / hide

Function hide

app/src/static/js/react-bootstrap.js:4914–4943  ·  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

4912
4913
4914function hide(data) {
4915 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
4916 return data;
4917 }
4918
4919 var refRect = data.offsets.reference;
4920 var bound = find(data.instance.modifiers, function (modifier) {
4921 return modifier.name === 'preventOverflow';
4922 }).boundaries;
4923
4924 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
4925 // Avoid unnecessary DOM access if visibility hasn't changed
4926 if (data.hide === true) {
4927 return data;
4928 }
4929
4930 data.hide = true;
4931 data.attributes['x-out-of-boundaries'] = '';
4932 } else {
4933 // Avoid unnecessary DOM access if visibility hasn't changed
4934 if (data.hide === false) {
4935 return data;
4936 }
4937
4938 data.hide = false;
4939 data.attributes['x-out-of-boundaries'] = false;
4940 }
4941
4942 return data;
4943}
4944/**
4945 * @function
4946 * @memberof Modifiers

Callers

nothing calls this directly

Calls 2

isModifierRequiredFunction · 0.85
findFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…