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
8134f3fb
Commit
8134f3fb
authored
May 15, 2016
by
David Faure
Browse files
fix PageUp/PageDown: clientHeight works, one of the other heights was the full document height.
parent
84b568e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
webengineviewer/src/webenginescript.cpp
View file @
8134f3fb
...
...
@@ -126,11 +126,10 @@ QString WebEngineScript::searchElementPosition(const QString &elementStr)
QString
WebEngineScript
::
scrollPercentage
(
int
percent
)
{
const
QString
source
=
QString
::
fromLatin1
(
"var current = document.body.scrollTop;"
"var body = document.body;"
"html = document.documentElement;"
"var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );"
"var docElement = document.documentElement;"
"var height = docElement.clientHeight;"
"var newPosition = current + height * %1 /100;"
"window.scrollTo(window.scrollX, newPosition);
[window.scrollX, window.scrollY];
"
).
arg
(
percent
);
"window.scrollTo(window.scrollX, newPosition);"
).
arg
(
percent
);
//qDebug() << "QString WebEngineScript::scrollPercentage(int percent) " << source;
return
source
;
...
...
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