onJsActiveArticleChanged was remove unintentionaly

This commit is contained in:
yifang 2021-12-19 18:58:48 +08:00
parent f292e0c251
commit d90c528819
2 changed files with 6 additions and 4 deletions

View file

@ -213,6 +213,7 @@ std::string ArticleMaker::makeHtmlHeader( QString const & word,
"el=document.getElementById( gdCurrentArticle ); el.className = el.className.replace(' gdactivearticle','');"
"el=document.getElementById( 'gdfrom-' + newId ); el.className = el.className + ' gdactivearticle';"
"gdCurrentArticle = 'gdfrom-' + newId; gdAudioLinks.current = newId;"
"articleview.onJsActiveArticleChanged(gdCurrentArticle); } }"
" } }"
"var overIframeId = null;"
"function gdSelectArticle( id ) {"
@ -657,6 +658,11 @@ void ArticleRequest::bodyFinished()
if ( closePrevSpan )
{
head += "</div></div><div style=\"clear:both;\"></div><span class=\"gdarticleseparator\"></span>";
} else {
// This is the first article
head += "<script type=\"text/javascript\">"
"var gdCurrentArticle=\"" + gdFrom + "\"; "
"articleview.onJsActiveArticleChanged(gdCurrentArticle)</script>";
}
bool collapse = false;

View file

@ -689,11 +689,7 @@ void ArticleView::setCurrentArticle( QString const & id, bool moveToIt )
if(moveToIt){
QString script=QString(" var elem=document.getElementById('%1'); if(elem!=undefined){elem.scrollIntoView(true);}").arg(id);
ui.definition->page()->runJavaScript(script);
onJsActiveArticleChanged(id);
ui.definition->setProperty("currentArticle",id);
}
}