Commit bab33aed authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

add more script to remove style to specific element

parent e5a15a25
......@@ -211,6 +211,8 @@ void MailWebEngineView::setElementByIdVisible(const QString &id, bool visible)
void MailWebEngineView::removeAttachmentMarking(const QString &id)
{
qDebug() << "bool MailWebEngineView::removeAttachmentMarking(const QString &id) not implemented";
page()->runJavaScript(MessageViewer::WebEngineScript::removeStyleToElement(QLatin1String("*#") + id));
#if 0
QWebElement doc = page()->mainFrame()->documentElement();
QWebElement attachmentDiv = doc.findFirst(QLatin1String("*#") + id);
......
......@@ -148,6 +148,12 @@ QString WebEngineScript::scrollToPosition(const QPoint &pos)
return source;
}
QString WebEngineScript::removeStyleToElement(const QString &element)
{
//TODO
return {};
}
QString WebEngineScript::setStyleToElement(const QString &elementStr, const QString &style)
{
const QString source = QString::fromLatin1("var element = document.getElementById('%1'); "
......
......@@ -37,6 +37,7 @@ MESSAGEVIEWER_EXPORT QString scrollDown(int pixel);
MESSAGEVIEWER_EXPORT QString scrollUp(int pixel);
MESSAGEVIEWER_EXPORT QString scrollPercentage(int percent);
MESSAGEVIEWER_EXPORT QString scrollToRelativePosition(int pos);
MESSAGEVIEWER_EXPORT QString removeStyleToElement(const QString &element);
}
}
#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