From d90c528819aaaaa8a8043683f3aae14cdb3d0cfd Mon Sep 17 00:00:00 2001 From: yifang Date: Sun, 19 Dec 2021 18:58:48 +0800 Subject: [PATCH] onJsActiveArticleChanged was remove unintentionaly --- article_maker.cc | 6 ++++++ articleview.cc | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/article_maker.cc b/article_maker.cc index abe8de78..0f57d839 100644 --- a/article_maker.cc +++ b/article_maker.cc @@ -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 += "
"; + } else { + // This is the first article + head += ""; } bool collapse = false; diff --git a/articleview.cc b/articleview.cc index 0dc73f64..a1f6db98 100644 --- a/articleview.cc +++ b/articleview.cc @@ -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); } }