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
c3db0ced
...
c3db0ced55156af07575dd6ddb3a6217ca26aca1
authored
2012-05-12 09:51:18 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
clientutils: use of findAll anywhere applicable
1 parent
392556ba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
modules/clientutils.js
modules/clientutils.js
View file @
c3db0ce
...
...
@@ -156,7 +156,7 @@
*/
this
.
exists
=
function
exists
(
selector
)
{
try
{
return
document
.
querySelector
All
(
selector
).
length
>
0
;
return
this
.
find
All
(
selector
).
length
>
0
;
}
catch
(
e
)
{
return
false
;
}
...
...
@@ -195,7 +195,7 @@
if
(
!
(
form
instanceof
HTMLElement
)
||
typeof
form
===
"string"
)
{
__utils__
.
log
(
"attempting to fetch form element from selector: '"
+
form
+
"'"
,
"info"
);
try
{
form
=
document
.
querySelector
(
form
);
form
=
this
.
findOne
(
form
);
}
catch
(
e
)
{
if
(
e
.
name
===
"SYNTAX_ERR"
)
{
out
.
errors
.
push
(
"invalid form selector provided: '"
+
form
+
"'"
);
...
...
@@ -328,7 +328,7 @@
*/
this
.
getElementBounds
=
function
getElementBounds
(
selector
)
{
try
{
var
clipRect
=
document
.
querySelector
(
selector
).
getBoundingClientRect
();
var
clipRect
=
this
.
findOne
(
selector
).
getBoundingClientRect
();
return
{
top
:
clipRect
.
top
,
left
:
clipRect
.
left
,
...
...
@@ -477,7 +477,7 @@
*/
this
.
visible
=
function
visible
(
selector
)
{
try
{
var
el
=
document
.
querySelector
(
selector
);
var
el
=
this
.
findOne
(
selector
);
return
el
&&
el
.
style
.
visibility
!==
'hidden'
&&
el
.
offsetHeight
>
0
&&
el
.
offsetWidth
>
0
;
}
catch
(
e
)
{
return
false
;
...
...
Please
register
or
sign in
to post a comment