Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michael Iseard
Kudos-Donations
Commits
5d076262
Commit
5d076262
authored
Oct 12, 2021
by
Michael Iseard
Browse files
Add additional check to isVisible function
parent
027309e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/common/helpers/util.js
View file @
5d076262
...
...
@@ -3,7 +3,7 @@ export function capitalizeFirstLetter(string) {
}
export
function
camelize
(
str
)
{
return
str
.
replace
(
/
(
?:
^
\w
|
[
A-Z
]
|
\b\w)
/g
,
function
(
word
,
index
)
{
return
str
.
replace
(
/
(
^
\w
|
[
A-Z
]
|
\b\w)
/g
,
function
(
word
,
index
)
{
return
index
===
0
?
word
.
toLowerCase
()
:
word
.
toUpperCase
()
}).
replace
(
/
\s
+/g
,
''
)
}
...
...
@@ -34,6 +34,10 @@ export function setAttributes(el, attrs) {
}
export
function
isVisible
(
el
)
{
// Check if element visible
if
(
el
.
offsetParent
===
null
)
return
false
// Check if in viewport
const
rect
=
el
.
getBoundingClientRect
();
return
(
rect
.
top
>=
0
&&
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment