Merge pull request #5648 from nextcloud-libraries/backport/5645/next

[next] refactor: Drop unused files from source
This commit is contained in:
Grigorii K. Shartsev 2024-05-28 20:28:17 +05:00 коммит произвёл GitHub
Родитель 87bbed6c48 91a7ae64df
Коммит 5bd3b5b4cf
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 0 добавлений и 36 удалений

Просмотреть файл

@ -1,36 +0,0 @@
/*!
* Check if an element is out of the viewport
* (c) 2018 Chris Ferdinandi, MIT License, https://gomakethings.com
* @param {Node} elem The element to check
* @return {Object} A set of booleans for each side of the element
*/
const isOutOfViewport = function(elem) {
// Get element's bounding
const bounding = elem.getBoundingClientRect()
const contentHeight = document.documentElement.clientHeight
const contentWidth = document.documentElement.clientWidth
// Check if it's out of the viewport on each side
const out = Object.assign({})
out.top = bounding.top < 0
out.left = bounding.left < 0
out.bottom = bounding.bottom > contentHeight
out.right = bounding.right > contentWidth
out.any = out.top || out.left || out.bottom || out.right
out.all = out.top && out.left && out.bottom && out.right
out.offsetY = out.top
? bounding.top
: out.bottom
? bounding.bottom - contentHeight
: 0
out.offsetX = out.left
? bounding.left
: out.right
? bounding.right - contentWidth
: 0
return out
}
export default isOutOfViewport