summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-04 06:05:10 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-04 06:05:22 (GMT)
commit69d08f7708e7bd0d683f0d0f52140f4c4051662e (patch)
treed7f803e1b59231dcc88683ead9a552eccbbc2e99
parent087bdde9c99917d482d64662ca77b7969a69fbea (diff)
Look at if we are at bottom
-rw-r--r--webengineviewer/src/webenginescript.cpp13
-rw-r--r--webengineviewer/src/webenginescript.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/webengineviewer/src/webenginescript.cpp b/webengineviewer/src/webenginescript.cpp
index 12efcef..6f03bf2 100644
--- a/webengineviewer/src/webenginescript.cpp
+++ b/webengineviewer/src/webenginescript.cpp
@@ -180,3 +180,16 @@ QString WebEngineScript::scrollToRelativePosition(qreal pos)
const QString source = QString::fromLatin1("window.scrollTo(window.scrollX, %1); [window.scrollX, window.scrollY];").arg(pos);
return source;
}
+
+QString WebEngineScript::isScrolledToBottom()
+{
+ //TODO
+ return {};
+ /*
+ $(window).scroll(function() {
+ if($(window).scrollTop() + $(window).height() == $(document).height()) {
+ alert("bottom!");
+ }
+ });
+ */
+}
diff --git a/webengineviewer/src/webenginescript.h b/webengineviewer/src/webenginescript.h
index 0bb7dbe..8798fc6 100644
--- a/webengineviewer/src/webenginescript.h
+++ b/webengineviewer/src/webenginescript.h
@@ -40,6 +40,7 @@ WEBENGINEVIEWER_EXPORT QString scrollUp(int pixel);
WEBENGINEVIEWER_EXPORT QString scrollPercentage(int percent);
WEBENGINEVIEWER_EXPORT QString scrollToRelativePosition(qreal pos);
WEBENGINEVIEWER_EXPORT QString removeStyleToElement(const QString &element);
+WEBENGINEVIEWER_EXPORT QString isScrolledToBottom();
}
}
#endif // WEBENGINESCRIPT_H