Commit f4cd2505 authored by Laurent Montel's avatar Laurent Montel 😁

Add missing script

parent 31bdc626
......@@ -181,3 +181,18 @@ 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()
{
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); "
"}());");
}
......@@ -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 WebEngineScript::isScrolledToBottom();
}
}
#endif // WEBENGINESCRIPT_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment