Merge pull request #2005 from xiaoyifang/opt/ui-interaction
Some checks failed
SonarCloud / Build and analyze (push) Has been cancelled

opt: remove the tooltip ,too simple to display
This commit is contained in:
xiaoyifang 2024-12-02 15:05:42 +08:00 committed by GitHub
commit ec364f0638
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 17 deletions

View file

@ -133,19 +133,6 @@ std::string ArticleMaker::makeHtmlHeader( QString const & word, QString const &
R"(<link rel="icon" type="image/png" href="qrc:///flags/)" + Html::escape( icon.toUtf8().data() ) + "\" >\n";
}
result += QString::fromUtf8( R"(
<script>
function tr(key) {
var tr_map = {
"Expand article": "%1", "Collapse article": "%2"
};
return tr_map[key] || '';
}
</script>
)" )
.arg( tr( "Expand article" ), tr( "Collapse article" ) )
.toStdString();
result += R"(<script src="qrc:///scripts/gd-builtin.js"></script>)";
result += R"(<script src="qrc:///scripts/mark.min.js"></script>)";
@ -676,11 +663,11 @@ void ArticleRequest::bodyFinished()
</div>)" ),
dictId,
collapse ? R"(style="cursor:pointer;")" : "",
collapse ? tr( "Expand article" ).toStdString() : "",
"",
Html::escape( tr( "From " ).toStdString() ),
Html::escape( activeDict->getName() ),
collapse ? "gdexpandicon" : "gdcollapseicon",
collapse ? "" : tr( "Collapse article" ).toStdString() );
"" );
head += R"(<div class="gddictnamebodyseparator"></div>)";

View file

@ -98,7 +98,6 @@ function gdExpandArticle(id) {
nm = document.getElementById("gddictname-" + id);
nm.style.cursor = "pointer";
if (ev) ev.stopPropagation();
ico.title = tr("Expand article");
nm.title = "";
articleview.collapseInHtml(id, true);
} else if (elem.style.display == "none") {
@ -108,7 +107,6 @@ function gdExpandArticle(id) {
nm = document.getElementById("gddictname-" + id);
nm.style.cursor = "default";
nm.title = "";
ico.title = tr("Collapse article");
articleview.collapseInHtml(id, false);
}
}