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
PIM
PIM Messagelib
Commits
9a73cfc5
Commit
9a73cfc5
authored
Mar 25, 2016
by
Laurent Montel
😁
Browse files
Use getElementById
parent
42888a60
Changes
2
Hide whitespace changes
Inline
Side-by-side
messageviewer/src/webengine/tests/testwebenginescrolladdattachment.cpp
View file @
9a73cfc5
...
...
@@ -73,7 +73,7 @@ void TestWebEngineScrollAddAttachment::handleScrollToAnchor(const QVariant &resu
void
TestWebEngineScrollAddAttachment
::
slotScrollToAttachment
()
{
mTestWebEngine
->
page
()
->
runJavaScript
(
MessageViewer
::
WebEngineScript
::
searchElementPosition
(
QStringLiteral
(
"
#
module"
)),
invoke
(
this
,
&
TestWebEngineScrollAddAttachment
::
handleScrollToAnchor
));
mTestWebEngine
->
page
()
->
runJavaScript
(
MessageViewer
::
WebEngineScript
::
searchElementPosition
(
QStringLiteral
(
"module"
)),
invoke
(
this
,
&
TestWebEngineScrollAddAttachment
::
handleScrollToAnchor
));
}
int
main
(
int
argc
,
char
*
argv
[])
...
...
messageviewer/src/webengine/webenginescript.cpp
View file @
9a73cfc5
...
...
@@ -98,7 +98,7 @@ QString WebEngineScript::findAllAnchorsAndForms()
QString
WebEngineScript
::
searchElementPosition
(
const
QString
&
elementStr
)
{
const
QString
source
=
QString
::
fromLatin1
(
"var element = document.
querySelector
('%1'); "
const
QString
source
=
QString
::
fromLatin1
(
"var element = document.
getElementById
('%1'); "
"if (element) { "
" var geometry = element.getBoundingClientRect(); "
" [(geometry.left + window.scrollX), (geometry.top + window.scrollY)]; "
...
...
Write
Preview
Supports
Markdown
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