Ancora update dei nuGet packages (bootstrap, popper...)

This commit is contained in:
Samuele E. Locatelli
2020-01-21 10:16:11 +01:00
parent 8c80435f5c
commit 4d34224562
115 changed files with 5530 additions and 1278 deletions
+21
View File
@@ -0,0 +1,21 @@
import getScroll from './getScroll';
/*
* Sum or subtract the element scroll values (left and top) from a given rect object
* @method
* @memberof Popper.Utils
* @param {Object} rect - Rect object you want to change
* @param {HTMLElement} element - The element from the function reads the scroll values
* @param {Boolean} subtract - set to true if you want to subtract the scroll values
* @return {Object} rect - The modifier rect object
*/
export default function includeScroll(rect, element, subtract = false) {
const scrollTop = getScroll(element, 'top');
const scrollLeft = getScroll(element, 'left');
const modifier = subtract ? -1 : 1;
rect.top += scrollTop * modifier;
rect.bottom += scrollTop * modifier;
rect.left += scrollLeft * modifier;
rect.right += scrollLeft * modifier;
return rect;
}