@@ -23,13 +23,6 @@ var annotationsViewer = {
23
23
24
24
e . preventDefault ( ) ;
25
25
26
- // make sure the code view overlay is off before showing the annotations view
27
- $ ( '#sg-t-code' ) . removeClass ( 'active' ) ;
28
- codeViewer . codeActive = false ;
29
- var obj = JSON . stringify ( { "codeToggle" : "off" } ) ;
30
- document . getElementById ( 'sg-viewport' ) . contentWindow . postMessage ( obj , annotationsViewer . targetOrigin ) ;
31
- codeViewer . slideCode ( 999 ) ;
32
-
33
26
// remove the class from the "eye" nav item
34
27
$ ( '#sg-t-toggle' ) . removeClass ( 'active' ) ;
35
28
@@ -60,9 +53,20 @@ var annotationsViewer = {
60
53
* open the annotations panel
61
54
*/
62
55
openComments : function ( ) {
63
- annotationsViewer . commentsActive = true ;
56
+
57
+ // make sure the code view overlay is off before showing the annotations view
58
+ $ ( '#sg-t-code' ) . removeClass ( 'active' ) ;
59
+ codeViewer . codeActive = false ;
60
+ var obj = JSON . stringify ( { "codeToggle" : "off" } ) ;
61
+ document . getElementById ( 'sg-viewport' ) . contentWindow . postMessage ( obj , annotationsViewer . targetOrigin ) ;
62
+ codeViewer . slideCode ( 999 ) ;
63
+
64
+ // tell the iframe annotation view has been turned on
64
65
var obj = JSON . stringify ( { "commentToggle" : "on" } ) ;
65
66
document . getElementById ( 'sg-viewport' ) . contentWindow . postMessage ( obj , annotationsViewer . targetOrigin ) ;
67
+
68
+ // note that it's turned on in the viewer
69
+ annotationsViewer . commentsActive = true ;
66
70
$ ( '#sg-t-annotations' ) . addClass ( 'active' ) ;
67
71
} ,
68
72
0 commit comments