code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function getReferenceNode(reference) {
return reference && reference.referenceNode ? reference.referenceNode : reference;
} | Returns the reference node of the reference object, or the reference object itself.
@method
@memberof Popper.Utils
@param {Element|Object} reference - the reference element (the popper will be relative to this)
@returns {Element} parent | getReferenceNode | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function isIE(version) {
if (version === 11) {
return isIE11;
}
if (version === 10) {
return isIE10;
}
return isIE11 || isIE10;
} | Determines if the browser is Internet Explorer
@method
@memberof Popper.Utils
@param {Number} version to check
@returns {Boolean} isIE | isIE | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getOffsetParent(element) {
if (!element) {
return document.documentElement;
}
var noOffsetParent = isIE(10) ? document.body : null;
// NOTE: 1 DOM access here
var offsetParent = element.offsetParent || null;
// Skip hidden elements which don't have an offsetParent
while (off... | Returns the offset parent of the given element
@method
@memberof Popper.Utils
@argument {Element} element
@returns {Element} offset parent | getOffsetParent | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function isOffsetContainer(element) {
var nodeName = element.nodeName;
if (nodeName === 'BODY') {
return false;
}
return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
} | Returns the offset parent of the given element
@method
@memberof Popper.Utils
@argument {Element} element
@returns {Element} offset parent | isOffsetContainer | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getRoot(node) {
if (node.parentNode !== null) {
return getRoot(node.parentNode);
}
return node;
} | Finds the root node (document, shadowDOM root) of the given element
@method
@memberof Popper.Utils
@argument {Element} node
@returns {Element} root node | getRoot | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function findCommonOffsetParent(element1, element2) {
// This check is needed to avoid errors in case one of the elements isn't defined for any reason
if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
return document.documentElement;
}
// Here we make sure to give as "star... | Finds the offset parent common to the two provided nodes
@method
@memberof Popper.Utils
@argument {Element} element1
@argument {Element} element2
@returns {Element} common offset parent | findCommonOffsetParent | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getScroll(element) {
var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
var nodeName = element.nodeName;
if (nodeName === 'BODY' || nodeName === 'HTML') {
var html = element.ownerDocument.doc... | Gets the scroll value of the given element in the given side (top and left)
@method
@memberof Popper.Utils
@argument {Element} element
@argument {String} side `top` or `left`
@returns {number} amount of scrolled pixels | getScroll | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function includeScroll(rect, element) {
var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var scrollTop = getScroll(element, 'top');
var scrollLeft = getScroll(element, 'left');
var modifier = subtract ? -1 : 1;
rect.top += scrollTop * modifier;
rect.bott... | Gets the scroll value of the given element in the given side (top and left)
@method
@memberof Popper.Utils
@argument {Element} element
@argument {String} side `top` or `left`
@returns {number} amount of scrolled pixels | includeScroll | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getBordersSize(styles, axis) {
var sideA = axis === 'x' ? 'Left' : 'Top';
var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);
} | Gets the scroll value of the given element in the given side (top and left)
@method
@memberof Popper.Utils
@argument {Element} element
@argument {String} side `top` or `left`
@returns {number} amount of scrolled pixels | getBordersSize | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getSize(axis, body, html, computedStyle) {
return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(comp... | Gets the scroll value of the given element in the given side (top and left)
@method
@memberof Popper.Utils
@argument {Element} element
@argument {String} side `top` or `left`
@returns {number} amount of scrolled pixels | getSize | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getWindowSizes(document) {
var body = document.body;
var html = document.documentElement;
var computedStyle = isIE(10) && getComputedStyle(html);
return {
height: getSize('Height', body, html, computedStyle),
width: getSize('Width', body, html, computedStyle)
};
} | Gets the scroll value of the given element in the given side (top and left)
@method
@memberof Popper.Utils
@argument {Element} element
@argument {String} side `top` or `left`
@returns {number} amount of scrolled pixels | getWindowSizes | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
} | Gets the scroll value of the given element in the given side (top and left)
@method
@memberof Popper.Utils
@argument {Element} element
@argument {String} side `top` or `left`
@returns {number} amount of scrolled pixels | classCallCheck | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.definePropert... | Gets the scroll value of the given element in the given side (top and left)
@method
@memberof Popper.Utils
@argument {Element} element
@argument {String} side `top` or `left`
@returns {number} amount of scrolled pixels | defineProperties | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
defineProperty = function (obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
} | Gets the scroll value of the given element in the given side (top and left)
@method
@memberof Popper.Utils
@argument {Element} element
@argument {String} side `top` or `left`
@returns {number} amount of scrolled pixels | defineProperty | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getClientRect(offsets) {
return _extends({}, offsets, {
right: offsets.left + offsets.width,
bottom: offsets.top + offsets.height
});
} | Given element offsets, generate an output similar to getBoundingClientRect
@method
@memberof Popper.Utils
@argument {Object} offsets
@returns {Object} ClientRect like output | getClientRect | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getBoundingClientRect(element) {
var rect = {};
// IE10 10 FIX: Please, don't ask, the element isn't
// considered in DOM in some circumstances...
// This isn't reproducible in IE10 compatibility mode of IE11
try {
if (isIE(10)) {
rect = element.getBoundingClientRect();
... | Get bounding client rect of given element
@method
@memberof Popper.Utils
@param {HTMLElement} element
@return {Object} client rect | getBoundingClientRect | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getOffsetRectRelativeToArbitraryNode(children, parent) {
var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var isIE10 = isIE(10);
var isHTML = parent.nodeName === 'HTML';
var childrenRect = getBoundingClientRect(children);
var parentRect = getBo... | Get bounding client rect of given element
@method
@memberof Popper.Utils
@param {HTMLElement} element
@return {Object} client rect | getOffsetRectRelativeToArbitraryNode | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getViewportOffsetRectRelativeToArtbitraryNode(element) {
var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var html = element.ownerDocument.documentElement;
var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
var width = Math.m... | Get bounding client rect of given element
@method
@memberof Popper.Utils
@param {HTMLElement} element
@return {Object} client rect | getViewportOffsetRectRelativeToArtbitraryNode | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function isFixed(element) {
var nodeName = element.nodeName;
if (nodeName === 'BODY' || nodeName === 'HTML') {
return false;
}
if (getStyleComputedProperty(element, 'position') === 'fixed') {
return true;
}
var parentNode = getParentNode(element);
if (!parentNode) {
return ... | Check if the given element is fixed or is inside a fixed parent
@method
@memberof Popper.Utils
@argument {Element} element
@argument {Element} customContainer
@returns {Boolean} answer to "isFixed?" | isFixed | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getFixedPositionOffsetParent(element) {
// This check is needed to avoid errors in case one of the elements isn't defined for any reason
if (!element || !element.parentElement || isIE()) {
return document.documentElement;
}
var el = element.parentElement;
while (el && getStyleComputed... | Finds the first parent of an element that has a transformed property defined
@method
@memberof Popper.Utils
@argument {Element} element
@returns {Element} first transformed parent or documentElement | getFixedPositionOffsetParent | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
if (placement.indexOf('auto') === -1) {
return placement;
}
var boundaries = getBoundaries(popper, reference, padding, bo... | Utility used to transform the `auto` placement to the placement with more
available space.
@method
@memberof Popper.Utils
@argument {Object} data - The data object generated by update method
@argument {Object} options - Modifiers configuration and options
@returns {Object} The data object, properly modified | computeAutoPlacement | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getReferenceOffsets(state, popper, reference) {
var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
return getOffse... | Get offsets to the reference element
@method
@memberof Popper.Utils
@param {Object} state
@param {Element} popper - the popper element
@param {Element} reference - the reference element (the popper will be relative to this)
@param {Element} fixedPosition - is in fixed position mode
@returns {Object} An object containin... | getReferenceOffsets | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getOuterSizes(element) {
var window = element.ownerDocument.defaultView;
var styles = window.getComputedStyle(element);
var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
var res... | Get the outer sizes of the given element (offset size + margins)
@method
@memberof Popper.Utils
@argument {Element} element
@returns {Object} object containing width and height properties | getOuterSizes | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getOppositePlacement(placement) {
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
return placement.replace(/left|right|bottom|top/g, function (matched) {
return hash[matched];
});
} | Get the opposite placement of the given one
@method
@memberof Popper.Utils
@argument {String} placement
@returns {String} flipped placement | getOppositePlacement | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getPopperOffsets(popper, referenceOffsets, placement) {
placement = placement.split('-')[0];
// Get popper node sizes
var popperRect = getOuterSizes(popper);
// Add position, width and height to our offsets object
var popperOffsets = {
width: popperRect.width,
height: popperRe... | Get offsets to the popper
@method
@memberof Popper.Utils
@param {Object} position - CSS position the Popper will get applied
@param {HTMLElement} popper - the popper element
@param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
@param {String} placement - one of the valid placem... | getPopperOffsets | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function find(arr, check) {
// use native find if supported
if (Array.prototype.find) {
return arr.find(check);
}
// use `filter` to obtain the same behavior of `find`
return arr.filter(check)[0];
} | Mimics the `find` method of Array
@method
@memberof Popper.Utils
@argument {Array} arr
@argument prop
@argument value
@returns index or -1 | find | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function findIndex(arr, prop, value) {
// use native findIndex if supported
if (Array.prototype.findIndex) {
return arr.findIndex(function (cur) {
return cur[prop] === value;
});
}
// use `find` + `indexOf` if `findIndex` isn't supported
var match = find(arr, function (obj) {
... | Return the index of the matching object
@method
@memberof Popper.Utils
@argument {Array} arr
@argument prop
@argument value
@returns index or -1 | findIndex | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function runModifiers(modifiers, data, ends) {
var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
modifiersToRun.forEach(function (modifier) {
if (modifier['function']) {
// eslint-disable-line dot-notation
console.warn('`modifier... | 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 {dataObject} | runModifiers | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function update() {
// if popper is destroyed, don't perform any further update
if (this.state.isDestroyed) {
return;
}
var data = {
instance: this,
styles: {},
arrowStyles: {},
attributes: {},
flipped: false,
offsets: {}
};
// compute reference elemen... | Updates the position of the popper, computing the new offsets and applying
the new style.<br />
Prefer `scheduleUpdate` over `update` because of performance reasons.
@method
@memberof Popper | update | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function isModifierEnabled(modifiers, modifierName) {
return modifiers.some(function (_ref) {
var name = _ref.name,
enabled = _ref.enabled;
return enabled && name === modifierName;
});
} | Helper used to know if the given modifier is enabled.
@method
@memberof Popper.Utils
@returns {Boolean} | isModifierEnabled | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getSupportedPropertyName(property) {
var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
for (var i = 0; i < prefixes.length; i++) {
var prefix = prefixes[i];
var toCheck = prefix ? '' + prefix + upperProp : property... | Get the prefixed supported property name
@method
@memberof Popper.Utils
@argument {String} property (camelCase)
@returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) | getSupportedPropertyName | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function destroy() {
this.state.isDestroyed = true;
// touch DOM only if `applyStyle` modifier is enabled
if (isModifierEnabled(this.modifiers, 'applyStyle')) {
this.popper.removeAttribute('x-placement');
this.popper.style.position = '';
this.popper.style.top = '';
this.popper.style... | Destroys the popper.
@method
@memberof Popper | destroy | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getWindow(element) {
var ownerDocument = element.ownerDocument;
return ownerDocument ? ownerDocument.defaultView : window;
} | Get the window associated with the element
@argument {Element} element
@returns {Window} | getWindow | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function attachToScrollParents(scrollParent, event, callback, scrollParents) {
var isBody = scrollParent.nodeName === 'BODY';
var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
target.addEventListener(event, callback, { passive: true });
if (!isBody) {
attachToScrollPare... | Get the window associated with the element
@argument {Element} element
@returns {Window} | attachToScrollParents | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function setupEventListeners(reference, options, state, updateBound) {
// Resize event listener on window
state.updateBound = updateBound;
getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
// Scroll event listener on scroll parents
var scrollElement = getScrollP... | Setup needed event listeners used to update the popper position
@method
@memberof Popper.Utils
@private | setupEventListeners | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function enableEventListeners() {
if (!this.state.eventsEnabled) {
this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
}
} | It will add resize/scroll events and start recalculating
position of the popper element when they are triggered.
@method
@memberof Popper | enableEventListeners | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function removeEventListeners(reference, state) {
// Remove resize event listener on window
getWindow(reference).removeEventListener('resize', state.updateBound);
// Remove scroll event listener on scroll parents
state.scrollParents.forEach(function (target) {
target.removeEventListener('scroll',... | Remove event listeners used to update the popper position
@method
@memberof Popper.Utils
@private | removeEventListeners | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function disableEventListeners() {
if (this.state.eventsEnabled) {
cancelAnimationFrame(this.scheduleUpdate);
this.state = removeEventListeners(this.reference, this.state);
}
} | It will remove resize/scroll events and won't recalculate popper position
when they are triggered. It also won't trigger `onUpdate` callback anymore,
unless you call `update` method manually.
@method
@memberof Popper | disableEventListeners | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function isNumeric(n) {
return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
} | Tells if a given input is a number
@method
@memberof Popper.Utils
@param {*} input to check
@return {Boolean} | isNumeric | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function setStyles(element, styles) {
Object.keys(styles).forEach(function (prop) {
var unit = '';
// add unit if the value is numeric and is one of the following
if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
unit = 'px';
... | 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 | setStyles | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function setAttributes(element, attributes) {
Object.keys(attributes).forEach(function (prop) {
var value = attributes[prop];
if (value !== false) {
element.setAttribute(prop, attributes[prop]);
} else {
element.removeAttribute(prop);
}
});
} | Set the attributes to the given popper
@method
@memberof Popper.Utils
@argument {Element} element - Element to apply the attributes to
@argument {Object} styles
Object with a list of properties and values which will be applied to the element | setAttributes | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function applyStyle(data) {
// any property present in `data.styles` will be applied to the popper,
// in this way we can make the 3rd party modifiers add custom styles to it
// Be aware, modifiers could override the properties defined in the previous
// lines of this modifier!
setStyles(data.instan... | @function
@memberof Modifiers
@argument {Object} data - The data object generated by `update` method
@argument {Object} data.styles - List of style properties - values to apply to popper element
@argument {Object} data.attributes - List of attribute properties - values to apply to popper element
@argument {Object} opti... | applyStyle | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
// compute reference element offsets
var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
// compute auto placement, store placement inside the data object,
// modifiers will be able ... | Set the x-placement attribute before everything else because it could be used
to add margins to the popper margins needs to be calculated to get the
correct popper offsets.
@method
@memberof Popper.modifiers
@param {HTMLElement} reference - The reference element used to position the popper
@param {HTMLElement} popper -... | applyStyleOnLoad | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getRoundedOffsets(data, shouldRound) {
var _data$offsets = data.offsets,
popper = _data$offsets.popper,
reference = _data$offsets.reference;
var round = Math.round,
floor = Math.floor;
var noRound = function noRound(v) {
return v;
};
var referenceWidth = roun... | @function
@memberof Popper.Utils
@argument {Object} data - The data object generated by `update` method
@argument {Boolean} shouldRound - If the offsets should be rounded at all
@returns {Object} The popper's position offsets rounded
The tale of pixel-perfect positioning. It's still not 100% perfect, but as
good as it... | getRoundedOffsets | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
noRound = function noRound(v) {
return v;
} | @function
@memberof Popper.Utils
@argument {Object} data - The data object generated by `update` method
@argument {Boolean} shouldRound - If the offsets should be rounded at all
@returns {Object} The popper's position offsets rounded
The tale of pixel-perfect positioning. It's still not 100% perfect, but as
good as it... | noRound | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function computeStyle(data, options) {
var x = options.x,
y = options.y;
var popper = data.offsets.popper;
// Remove this legacy support in Popper.js v2
var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
return modifier.name === 'applyStyle';
}).gpu... | @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 | computeStyle | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function isModifierRequired(modifiers, requestingName, requestedName) {
var requesting = find(modifiers, function (_ref) {
var name = _ref.name;
return name === requestingName;
});
var isRequired = !!requesting && modifiers.some(function (modifier) {
return modifier.name === requestedName... | Helper used to know if the given modifier depends from another one.<br />
It checks if the needed modifier is listed and enabled.
@method
@memberof Popper.Utils
@param {Array} modifiers - list of modifiers
@param {String} requestingName - name of requesting modifier
@param {String} requestedName - name of requested mod... | isModifierRequired | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function arrow(data, options) {
var _data$offsets$arrow;
// arrow depends on keepTogether in order to work
if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
return data;
}
var arrowElement = options.element;
// if arrowElement is a string, suppose it's a CSS s... | @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 | arrow | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function getOppositeVariation(variation) {
if (variation === 'end') {
return 'start';
} else if (variation === 'start') {
return 'end';
}
return variation;
} | Get the opposite placement variation of the given one
@method
@memberof Popper.Utils
@argument {String} placement variation
@returns {String} flipped placement variation | getOppositeVariation | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function clockwise(placement) {
var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var index = validPlacements.indexOf(placement);
var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
return counter ? arr.reverse() : arr;
} | Given an initial placement, returns all the subsequent placements
clockwise (or counter-clockwise).
@method
@memberof Popper.Utils
@argument {String} placement - A valid placement (it accepts variations)
@argument {Boolean} counter - Set to true to walk the placements counterclockwise
@returns {Array} placements inclu... | clockwise | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function flip(data, options) {
// if `inner` modifier is enabled, we can't use the `flip` modifier
if (isModifierEnabled(data.instance.modifiers, 'inner')) {
return data;
}
if (data.flipped && data.placement === data.originalPlacement) {
// seems like flip is trying to loop, probably there'... | @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 | flip | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function keepTogether(data) {
var _data$offsets = data.offsets,
popper = _data$offsets.popper,
reference = _data$offsets.reference;
var placement = data.placement.split('-')[0];
var floor = Math.floor;
var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
var side = isVertic... | @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 | keepTogether | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function toValue(str, measurement, popperOffsets, referenceOffsets) {
// separate value from unit
var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
var value = +split[1];
var unit = split[2];
// If it's not a number it's an operator, I guess
if (!value) {
return str;
}
if (unit... | Converts a string containing value + unit into a px value number
@function
@memberof {modifiers~offset}
@private
@argument {String} str - Value + unit string
@argument {String} measurement - `height` or `width`
@argument {Object} popperOffsets
@argument {Object} referenceOffsets
@returns {Number|String}
Value in pixels... | toValue | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
var offsets = [0, 0];
// Use height if placement is left or right and index is 0 otherwise use width
// in this way the first offset will use an axis and the second one
// will use the other one
var useHeight = ['right',... | Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
@function
@memberof {modifiers~offset}
@private
@argument {String} offset
@argument {Object} popperOffsets
@argument {Object} referenceOffsets
@argument {String} basePlacement
@returns {Array} a two cells array with x and y offsets in numbers | parseOffset | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function offset(data, _ref) {
var offset = _ref.offset;
var placement = data.placement,
_data$offsets = data.offsets,
popper = _data$offsets.popper,
reference = _data$offsets.reference;
var basePlacement = placement.split('-')[0];
var offsets = void 0;
if (isNumeric(+offset... | @function
@memberof Modifiers
@argument {Object} data - The data object generated by update method
@argument {Object} options - Modifiers configuration and options
@argument {Number|String} options.offset=0
The offset value as described in the modifier description
@returns {Object} The data object, properly modified | offset | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function preventOverflow(data, options) {
var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
// If offsetParent is the reference element, we really want to
// go one step up and use the next offsetParent as reference to
// avoid to make this modifier completely ... | @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 | preventOverflow | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function shift(data) {
var placement = data.placement;
var basePlacement = placement.split('-')[0];
var shiftvariation = placement.split('-')[1];
// if shift shiftvariation is specified, run the modifier
if (shiftvariation) {
var _data$offsets = data.offsets,
reference = _data$offse... | @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 | shift | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function hide(data) {
if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
return data;
}
var refRect = data.offsets.reference;
var bound = find(data.instance.modifiers, function (modifier) {
return modifier.name === 'preventOverflow';
}).boundaries;
if (r... | @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 | hide | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function inner(data) {
var placement = data.placement;
var basePlacement = placement.split('-')[0];
var _data$offsets = data.offsets,
popper = _data$offsets.popper,
reference = _data$offsets.reference;
var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
var subtractLengt... | @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 | inner | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function Popper(reference, popper) {
var _this = this;
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
classCallCheck(this, Popper);
this.scheduleUpdate = function () {
return requestAnimationFrame(_this.update);
};
// make update() de... | Creates a new Popper.js instance.
@class Popper
@param {Element|referenceObject} reference - The reference element used to position the popper
@param {Element} popper - The HTML / XML element used as the popper
@param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
@return {... | Popper | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
transitionComplete = function transitionComplete() {
if (_this4._config.focus) {
_this4._element.focus();
}
_this4._isTransitioning = false;
$__default["default"](_this4._element).trigger(shownEvent);
} | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | transitionComplete | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
callbackRemove = function callbackRemove() {
_this9._removeBackdrop();
if (callback) {
callback();
}
} | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | callbackRemove | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function allowedAttribute(attr, allowedAttributeList) {
var attrName = attr.nodeName.toLowerCase();
if (allowedAttributeList.indexOf(attrName) !== -1) {
if (uriAttrs.indexOf(attrName) !== -1) {
return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));
}
... | A pattern that matches safe data URLs. Only matches image, video and audio types.
Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts | allowedAttribute | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
if (unsafeHtml.length === 0) {
return unsafeHtml;
}
if (sanitizeFn && typeof sanitizeFn === 'function') {
return sanitizeFn(unsafeHtml);
}
var domParser = new window.DOMParser();
var createdDocument = domParser.parseFromStrin... | A pattern that matches safe data URLs. Only matches image, video and audio types.
Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts | sanitizeHtml | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
_loop = function _loop() {
var el = elements[i];
var elName = el.nodeName.toLowerCase();
if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
el.parentNode.removeChild(el);
return 1; // continue
}
var attributeList = [].slice.call(el.attributes);
// eslint-d... | A pattern that matches safe data URLs. Only matches image, video and audio types.
Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts | _loop | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.bundle.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.bundle.js | MIT |
transitionComplete = function transitionComplete() {
if (_this4._config.focus) {
_this4._element.focus();
}
_this4._isTransitioning = false;
$__default["default"](_this4._element).trigger(shownEvent);
} | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | transitionComplete | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.js | MIT |
callbackRemove = function callbackRemove() {
_this9._removeBackdrop();
if (callback) {
callback();
}
} | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | callbackRemove | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.js | MIT |
function allowedAttribute(attr, allowedAttributeList) {
var attrName = attr.nodeName.toLowerCase();
if (allowedAttributeList.indexOf(attrName) !== -1) {
if (uriAttrs.indexOf(attrName) !== -1) {
return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));
}
... | A pattern that matches safe data URLs. Only matches image, video and audio types.
Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts | allowedAttribute | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.js | MIT |
function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
if (unsafeHtml.length === 0) {
return unsafeHtml;
}
if (sanitizeFn && typeof sanitizeFn === 'function') {
return sanitizeFn(unsafeHtml);
}
var domParser = new window.DOMParser();
var createdDocument = domParser.parseFromStrin... | A pattern that matches safe data URLs. Only matches image, video and audio types.
Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts | sanitizeHtml | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.js | MIT |
_loop = function _loop() {
var el = elements[i];
var elName = el.nodeName.toLowerCase();
if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
el.parentNode.removeChild(el);
return 1; // continue
}
var attributeList = [].slice.call(el.attributes);
// eslint-d... | A pattern that matches safe data URLs. Only matches image, video and audio types.
Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts | _loop | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | dist/js/bootstrap.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/dist/js/bootstrap.js | MIT |
transitionComplete = function transitionComplete() {
cov_15idckumoh().f[19]++;
cov_15idckumoh().s[142]++;
if (_this4._config.focus) {
cov_15idckumoh().b[23][0]++;
cov_15idckumoh().s[143]++;
_this4._element.focus();
} else {
cov_15idckumoh().b[23][1... | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | transitionComplete | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/coverage/dist/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/coverage/dist/modal.js | MIT |
callbackRemove = function callbackRemove() {
cov_15idckumoh().f[31]++;
cov_15idckumoh().s[208]++;
_this9._removeBackdrop();
cov_15idckumoh().s[209]++;
if (callback) {
cov_15idckumoh().b[47][0]++;
cov_15idckumoh().s[210]++;
... | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | callbackRemove | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/coverage/dist/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/coverage/dist/modal.js | MIT |
function allowedAttribute(attr, allowedAttributeList) {
cov_1u3sawliq8().f[0]++;
var attrName = (cov_1u3sawliq8().s[5]++, attr.nodeName.toLowerCase());
cov_1u3sawliq8().s[6]++;
if (allowedAttributeList.indexOf(attrName) !== -1) {
cov_1u3sawliq8().b[0][0]++;
cov_1u3sawliq8().s[7]++;
if ... | A pattern that matches safe data URLs. Only matches image, video and audio types.
Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts | allowedAttribute | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/coverage/dist/tooltip.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/coverage/dist/tooltip.js | MIT |
function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
cov_1u3sawliq8().f[2]++;
cov_1u3sawliq8().s[18]++;
if (unsafeHtml.length === 0) {
cov_1u3sawliq8().b[4][0]++;
cov_1u3sawliq8().s[19]++;
return unsafeHtml;
} else {
cov_1u3sawliq8().b[4][1]++;
}
cov_1u3sawliq8().s[... | A pattern that matches safe data URLs. Only matches image, video and audio types.
Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts | sanitizeHtml | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/coverage/dist/tooltip.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/coverage/dist/tooltip.js | MIT |
_loop = function _loop() {
var el = (cov_1u3sawliq8().s[29]++, elements[i]);
var elName = (cov_1u3sawliq8().s[30]++, el.nodeName.toLowerCase());
cov_1u3sawliq8().s[31]++;
if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
cov_1u3sawliq8().b[7][0]++;
cov_1u3sawliq8().s... | A pattern that matches safe data URLs. Only matches image, video and audio types.
Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts | _loop | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/coverage/dist/tooltip.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/coverage/dist/tooltip.js | MIT |
function cov_18wxups0zb() {
var path = "/Users/mahdi/Documents/app/bootstrap-v4-rtl/js/src/tooltip.js";
var hash = "12d6ad0f79e4c18c4eb6a5a491e2bd141aa05800";
var global = new Function("return this")();
var gcv = "__coverage__";
var coverageData = {
path: "/Users/mahdi/Documents/app/bootstrap-... | A pattern that matches safe data URLs. Only matches image, video and audio types.
Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts | cov_18wxups0zb | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/coverage/dist/tooltip.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/coverage/dist/tooltip.js | MIT |
transitionComplete = function transitionComplete() {
if (_this4._config.focus) {
_this4._element.focus();
}
_this4._isTransitioning = false;
$__default["default"](_this4._element).trigger(shownEvent);
} | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | transitionComplete | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/dist/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/dist/modal.js | MIT |
callbackRemove = function callbackRemove() {
_this9._removeBackdrop();
if (callback) {
callback();
}
} | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | callbackRemove | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/dist/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/dist/modal.js | MIT |
function allowedAttribute(attr, allowedAttributeList) {
var attrName = attr.nodeName.toLowerCase();
if (allowedAttributeList.indexOf(attrName) !== -1) {
if (uriAttrs.indexOf(attrName) !== -1) {
return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));
}
... | A pattern that matches safe data URLs. Only matches image, video and audio types.
Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts | allowedAttribute | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/dist/tooltip.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/dist/tooltip.js | MIT |
function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
if (unsafeHtml.length === 0) {
return unsafeHtml;
}
if (sanitizeFn && typeof sanitizeFn === 'function') {
return sanitizeFn(unsafeHtml);
}
var domParser = new window.DOMParser();
var createdDocument = domParser.parseFromStrin... | A pattern that matches safe data URLs. Only matches image, video and audio types.
Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts | sanitizeHtml | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/dist/tooltip.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/dist/tooltip.js | MIT |
_loop = function _loop() {
var el = elements[i];
var elName = el.nodeName.toLowerCase();
if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
el.parentNode.removeChild(el);
return 1; // continue
}
var attributeList = [].slice.call(el.attributes);
// eslint-d... | A pattern that matches safe data URLs. Only matches image, video and audio types.
Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts | _loop | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/dist/tooltip.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/dist/tooltip.js | MIT |
_getConfig(config) {
config = {
...Default,
...config
}
Util.typeCheckConfig(NAME, config, DefaultType)
return config
} | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | _getConfig | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
_triggerBackdropTransition() {
const hideEventPrevented = $.Event(EVENT_HIDE_PREVENTED)
$(this._element).trigger(hideEventPrevented)
if (hideEventPrevented.isDefaultPrevented()) {
return
}
const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight
if (... | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | _triggerBackdropTransition | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
_showElement(relatedTarget) {
const transition = $(this._element).hasClass(CLASS_NAME_FADE)
const modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null
if (!this._element.parentNode ||
this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
// Don't move modal's... | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | _showElement | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
transitionComplete = () => {
if (this._config.focus) {
this._element.focus()
}
this._isTransitioning = false
$(this._element).trigger(shownEvent)
} | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | transitionComplete | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
transitionComplete = () => {
if (this._config.focus) {
this._element.focus()
}
this._isTransitioning = false
$(this._element).trigger(shownEvent)
} | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | transitionComplete | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
_enforceFocus() {
$(document)
.off(EVENT_FOCUSIN) // Guard against infinite focus loop
.on(EVENT_FOCUSIN, event => {
if (document !== event.target &&
this._element !== event.target &&
$(this._element).has(event.target).length === 0) {
this._element.focus()
... | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | _enforceFocus | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
_setEscapeEvent() {
if (this._isShown) {
$(this._element).on(EVENT_KEYDOWN_DISMISS, event => {
if (this._config.keyboard && event.which === ESCAPE_KEYCODE) {
event.preventDefault()
this.hide()
} else if (!this._config.keyboard && event.which === ESCAPE_KEYCODE) {
... | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | _setEscapeEvent | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
_setResizeEvent() {
if (this._isShown) {
$(window).on(EVENT_RESIZE, event => this.handleUpdate(event))
} else {
$(window).off(EVENT_RESIZE)
}
} | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | _setResizeEvent | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
_hideModal() {
this._element.style.display = 'none'
this._element.setAttribute('aria-hidden', true)
this._element.removeAttribute('aria-modal')
this._element.removeAttribute('role')
this._isTransitioning = false
this._showBackdrop(() => {
$(document.body).removeClass(CLASS_NAME_OPEN)
... | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | _hideModal | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
_removeBackdrop() {
if (this._backdrop) {
$(this._backdrop).remove()
this._backdrop = null
}
} | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | _removeBackdrop | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
_showBackdrop(callback) {
const animate = $(this._element).hasClass(CLASS_NAME_FADE) ?
CLASS_NAME_FADE : ''
if (this._isShown && this._config.backdrop) {
this._backdrop = document.createElement('div')
this._backdrop.className = CLASS_NAME_BACKDROP
if (animate) {
this._backdrop.... | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | _showBackdrop | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
callbackRemove = () => {
this._removeBackdrop()
if (callback) {
callback()
}
} | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | callbackRemove | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
callbackRemove = () => {
this._removeBackdrop()
if (callback) {
callback()
}
} | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | callbackRemove | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
_adjustDialog() {
const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight
if (!this._isBodyOverflowing && isModalOverflowing) {
this._element.style.paddingLeft = `${this._scrollbarWidth}px`
}
if (this._isBodyOverflowing && !isModalOverflowing) {
this._... | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | _adjustDialog | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
_resetAdjustments() {
this._element.style.paddingLeft = ''
this._element.style.paddingRight = ''
} | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | _resetAdjustments | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
_checkScrollbar() {
const rect = document.body.getBoundingClientRect()
this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth
this._scrollbarWidth = this._getScrollbarWidth()
} | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | _checkScrollbar | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
_setScrollbar() {
if (this._isBodyOverflowing) {
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
// while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
const fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT... | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | _setScrollbar | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
_resetScrollbar() {
// Restore fixed content padding
const fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT))
$(fixedContent).each((index, element) => {
const padding = $(element).data('padding-right')
$(element).removeData('padding-right')
element.style.paddin... | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | _resetScrollbar | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
_getScrollbarWidth() { // thx d.walsh
const scrollDiv = document.createElement('div')
scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER
document.body.appendChild(scrollDiv)
const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth
document.body.removeChild(scrollDiv)
... | `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
Do not move `document` in `htmlElements` array
It will remove `EVENT_CLICK_DATA_API` event that should remain | _getScrollbarWidth | javascript | MahdiMajidzadeh/bootstrap-v4-rtl | js/src/modal.js | https://github.com/MahdiMajidzadeh/bootstrap-v4-rtl/blob/master/js/src/modal.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.