This repository was archived by the owner on Feb 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ var annotationsViewer = {
10
10
11
11
// set-up default sections
12
12
commentsActive : false ,
13
- targetOrigin : ( window . location . protocol === "file:" ) ? "*" : window . location . protocol + "//" + window . location . host ,
13
+ targetOrigin : ( window . location . protocol === "file:" ) ? "*" : window . location . protocol + "//" + window . location . host ,
14
+ moveToOnInit : 0 ,
14
15
15
16
/**
16
17
* add the onclick handler to the annotations link in the main nav
@@ -34,6 +35,15 @@ var annotationsViewer = {
34
35
// initialize the annotations viewer
35
36
annotationsViewer . commentContainerInit ( ) ;
36
37
38
+ // load the query strings in case code view has to show by default
39
+ var queryStringVars = urlHandler . getRequestVars ( ) ;
40
+ if ( ( queryStringVars . view !== undefined ) && ( ( queryStringVars . view === "annotations" ) || ( queryStringVars . view === "a" ) ) ) {
41
+ annotationsViewer . openComments ( ) ;
42
+ if ( queryStringVars . number !== undefined ) {
43
+ annotationsViewer . moveToOnInit = queryStringVars . number ;
44
+ }
45
+ }
46
+
37
47
} ,
38
48
39
49
/**
@@ -187,6 +197,11 @@ var annotationsViewer = {
187
197
// slide the comment section into view
188
198
annotationsViewer . slideComment ( 0 ) ;
189
199
200
+ if ( annotationsViewer . moveToOnInit != "0" ) {
201
+ annotationsViewer . moveTo ( annotationsViewer . moveToOnInit ) ;
202
+ annotationsViewer . moveToOnInit = "0" ;
203
+ }
204
+
190
205
} ,
191
206
192
207
/**
You can’t perform that action at this time.
0 commit comments