Commit 4c7e0a8b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

We need to split toggleFullAddressList in too separate element

parent c3cc81e4
......@@ -199,6 +199,26 @@ QString WebEngineScript::injectAttachments(const QString &delayedHtml, const QSt
return source;
}
QString WebEngineScript::replaceInnerHtml(const QString &field, const QString &html, bool doShow)
{
const QString replaceInnerHtmlStr = QLatin1String("iconFull") + field + QLatin1String("AddressList");
const QString source = QString::fromLatin1("var doShow = %3;"
"var field = \'%4\';"
"var out = [];"
"var element = document.getElementById('%1'); "
"if (element) { "
" element.innerHTML = '%2';"
" out.push({"
" field: field,"
" doShow: doShow"
" });"
"}").arg(replaceInnerHtmlStr).arg(html).arg(doShow).arg(field);
qDebug() << "QString WebEngineScript::injectAttachments(const QString &delayedHtml, const QString &elementStr) :"<<source;
return source;
}
QString WebEngineScript::toggleFullAddressList(const QString &field, const QString &html, bool doShow)
{
const QString replaceInnerHtmlStr = QLatin1String("iconFull") + field + QLatin1String("AddressList");
......
......@@ -40,6 +40,7 @@ MESSAGEVIEWER_EXPORT QString scrollToRelativePosition(int pos);
MESSAGEVIEWER_EXPORT QString removeStyleToElement(const QString &element);
MESSAGEVIEWER_EXPORT QString injectAttachments(const QString &delayedHtml, const QString &element);
MESSAGEVIEWER_EXPORT QString toggleFullAddressList(const QString &field, const QString &html, bool doShow);
MESSAGEVIEWER_EXPORT QString replaceInnerHtml(const QString &field, const QString &html, bool doShow);
}
}
#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