Skip to content

Commit 994b081

Browse files
committed
issue #7412: HTML: Opening a reference link in a new tab does not scroll to the content
1 parent a0c75e4 commit 994b081

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/htmlgen.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,7 @@ static QCString substituteHtmlKeywords(const QCString &s,
300300
treeViewCssJs = "<link href=\"$relpath^navtree.css\" rel=\"stylesheet\" type=\"text/css\"/>\n"
301301
"<script type=\"text/javascript\" src=\"$relpath^resize.js\"></script>\n"
302302
"<script type=\"text/javascript\" src=\"$relpath^navtreedata.js\"></script>\n"
303-
"<script type=\"text/javascript\" src=\"$relpath^navtree.js\"></script>\n"
304-
"<script type=\"text/javascript\">\n"
305-
"/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n"
306-
" $(document).ready(initResizable);\n"
307-
"/* @license-end */"
308-
"</script>";
303+
"<script type=\"text/javascript\" src=\"$relpath^navtree.js\"></script>\n";
309304
}
310305

311306
if (searchEngine)
@@ -2372,7 +2367,7 @@ QCString HtmlGenerator::writeSplitBarAsString(const char *name,const char *relpa
23722367
"$(document).ready(function(){initNavTree('") +
23732368
QCString(name) + Doxygen::htmlFileExtension +
23742369
QCString("','") + relpath +
2375-
QCString("');});\n"
2370+
QCString("'); initResizable(); });\n"
23762371
"/* @license-end */\n"
23772372
"</script>\n"
23782373
"<div id=\"doc-content\">\n");

src/scanner.l

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,6 +1941,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
19411941
}
19421942
}
19431943
<CopyHereDocEnd>\n {
1944+
lineCount(yyscanner);
19441945
*yyextra->pCopyHereDocGString += yytext;
19451946
}
19461947
<CopyHereDocEnd>{ID} {
@@ -7186,10 +7187,12 @@ static void parseMain(yyscan_t yyscanner,
71867187
//depthIf = 0;
71877188
yyextra->protection = Public;
71887189
yyextra->mtype = Method;
7189-
yyextra->stat = FALSE;
7190+
yyextra->stat = FALSE;
71907191
yyextra->virt = Normal;
71917192
yyextra->current_root = rt;
7192-
yyextra->yyLineNr= 1 ;
7193+
yyextra->yyLineNr = 1 ;
7194+
yyextra->yyBegLineNr = 1;
7195+
yyextra->yyBegColNr = 0;
71937196
yyextra->yyFileName = fileName;
71947197
setContext(yyscanner);
71957198
bool processWithClang = yyextra->insideCpp || yyextra->insideObjC;

templates/html/resize.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ function initResizable()
9191
}
9292
collapsedWidth=width;
9393
}
94+
(document.getElementById(location.hash.slice(1))||document.body).scrollIntoView();
9495
}
9596

9697
function collapseExpand()

0 commit comments

Comments
 (0)