fix: iframe not auto expand

https://github.com/goldendict/goldendict/issues/1448
This commit is contained in:
yifang 2022-01-31 09:36:52 +08:00
parent 8048830246
commit ab7ffab225
2 changed files with 8 additions and 6 deletions

View file

@ -43,12 +43,14 @@ function playSound(sound) {
a.play();
}
function emitClickedEvent(link){
try{
function emitClickedEvent(link) {
try {
articleview.linkClickedInHtml(link);
}catch(error)
{
} catch (error) {
console.error(error);
}
}
function resizeIframe(obj) {
obj.style.height = obj.contentWindow.document.documentElement.scrollHeight + 'px';
}

View file

@ -389,7 +389,7 @@ sptr< DataRequest > WebSiteDictionary::getArticle( wstring const & str,
"\" onmouseover=\"processIframeMouseOver('gdexpandframe-" + getId() + "');\" "
"onmouseout=\"processIframeMouseOut();\" "
"scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" "
"frameborder=\"0\" vspace=\"0\" hspace=\"0\" "
"frameborder=\"0\" vspace=\"0\" hspace=\"0\" onload=\"resizeIframe(this)\""
"style=\"overflow:visible; width:100%; display:block;\">"
"</iframe>";