Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
7fc49456
...
7fc49456d5a2c551f68f84c5688a098470c91a81
authored
2013-03-23 12:39:57 -0500
by
Reid Lynch
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
more functional implementation of visible method
1 parent
977f74e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
modules/clientutils.js
modules/clientutils.js
View file @
7fc4945
...
...
@@ -777,16 +777,14 @@
*/
this
.
visible
=
function
visible
(
selector
)
{
try
{
var
el
,
comp
,
elems
=
this
.
findAll
(
selector
);
for
(
var
i
=
0
;
i
<
elems
.
length
;
i
++
)
{
el
=
elems
[
i
];
comp
=
window
.
getComputedStyle
(
el
,
null
);
if
(
comp
.
visibility
!==
'hidden'
&&
comp
.
display
!==
'none'
&&
el
.
offsetHeight
>
0
&&
el
.
offsetWidth
>
0
)
return
true
;
}
return
false
;
var
elems
=
this
.
findAll
(
selector
);
return
Array
.
prototype
.
some
.
call
(
elems
,
function
(
el
)
{
var
comp
=
window
.
getComputedStyle
(
el
,
null
);
return
comp
.
visibility
!==
'hidden'
&&
comp
.
display
!==
'none'
&&
el
.
offsetHeight
>
0
&&
el
.
offsetWidth
>
0
;
});
}
catch
(
e
)
{
return
false
;
}
...
...
Please
register
or
sign in
to post a comment