summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-05 06:17:12 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-05 06:17:12 (GMT)
commitf9cd0bbae68f61b1be24ce809c318bbf6780f468 (patch)
treef384b06d429a4ce7b2e4c9c8f70f54b7218b0d62
parentf90bb1875c8cf693b93e8e92ef7be55856c0efe5 (diff)
Fix return info about we are at bottom of page
-rw-r--r--webengineviewer/src/webenginescript.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/webengineviewer/src/webenginescript.cpp b/webengineviewer/src/webenginescript.cpp
index f16e315..24931ae 100644
--- a/webengineviewer/src/webenginescript.cpp
+++ b/webengineviewer/src/webenginescript.cpp
@@ -183,13 +183,14 @@ QString WebEngineScript::scrollToRelativePosition(qreal pos)
QString WebEngineScript::isScrolledToBottom()
{
- //TODO
- return QString::fromLatin1("qt.jQuery(window).scroll(function() { "
- " if (qt.jQuery(window).scrollTop() + qt.jQuery(window).height() == qt.jQuery(document).height()) "
- " { "
- " return true;"
- " } else {"
- " return false;"
- " } "
- "});");
+ return QString::fromLatin1("(function() { "
+ "var isAtBottom = 0;"
+ "if (qt.jQuery(window).scrollTop() + qt.jQuery(window).height() == qt.jQuery(document).height())"
+ "{ "
+ " isAtBottom = 1;"
+ "} else {"
+ " isAtBottom = 0;"
+ "}"
+ "return Boolean(isAtBottom); "
+ "}());");
}