This repository was archived by the owner on Feb 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,9 @@ var annotationsPattern = {
110
110
111
111
var parentEl ;
112
112
113
- if ( el . parentNode . classList . contains ( "sg-pattern" ) ) {
113
+ if ( el . classList . contains ( "sg-pattern" ) ) {
114
+ return el ;
115
+ } else if ( el . parentNode . classList . contains ( "sg-pattern" ) ) {
114
116
return el . parentNode ;
115
117
} else {
116
118
parentEl = annotationsPattern . findParent ( el . parentNode ) ;
Original file line number Diff line number Diff line change 9
9
var annotationsViewer = {
10
10
11
11
// set-up default sections
12
- commentsActive : false ,
13
- targetOrigin : ( window . location . protocol === "file:" ) ? "*" : window . location . protocol + "//" + window . location . host ,
14
- moveToOnInit : 0 ,
12
+ commentsActive : false ,
13
+ commentsViewAllActive : true ,
14
+ targetOrigin : ( window . location . protocol === "file:" ) ? "*" : window . location . protocol + "//" + window . location . host ,
15
+ moveToOnInit : 0 ,
15
16
16
17
/**
17
18
* add the onclick handler to the annotations link in the main nav
@@ -238,6 +239,11 @@ var annotationsViewer = {
238
239
return false ;
239
240
}
240
241
}
242
+ } else if ( data . patternpartial !== undefined ) {
243
+ if ( annotationsViewer . commentsViewAllActive && ( data . patternpartial . indexOf ( "viewall-" ) != - 1 ) ) {
244
+ var obj = JSON . stringify ( { "commentToggle" : "on" } ) ;
245
+ document . getElementById ( 'sg-viewport' ) . contentWindow . postMessage ( obj , annotationsViewer . targetOrigin ) ;
246
+ }
241
247
}
242
248
243
249
}
Original file line number Diff line number Diff line change @@ -110,7 +110,9 @@ var annotationsPattern = {
110
110
111
111
var parentEl ;
112
112
113
- if ( el . parentNode . classList . contains ( "sg-pattern" ) ) {
113
+ if ( el . classList . contains ( "sg-pattern" ) ) {
114
+ return el ;
115
+ } else if ( el . parentNode . classList . contains ( "sg-pattern" ) ) {
114
116
return el . parentNode ;
115
117
} else {
116
118
parentEl = annotationsPattern . findParent ( el . parentNode ) ;
Original file line number Diff line number Diff line change 9
9
var annotationsViewer = {
10
10
11
11
// set-up default sections
12
- commentsActive : false ,
13
- targetOrigin : ( window . location . protocol === "file:" ) ? "*" : window . location . protocol + "//" + window . location . host ,
14
- moveToOnInit : 0 ,
12
+ commentsActive : false ,
13
+ commentsViewAllActive : false ,
14
+ targetOrigin : ( window . location . protocol === "file:" ) ? "*" : window . location . protocol + "//" + window . location . host ,
15
+ moveToOnInit : 0 ,
15
16
16
17
/**
17
18
* add the onclick handler to the annotations link in the main nav
@@ -238,6 +239,11 @@ var annotationsViewer = {
238
239
return false ;
239
240
}
240
241
}
242
+ } else if ( data . patternpartial !== undefined ) {
243
+ if ( annotationsViewer . commentsViewAllActive && ( data . patternpartial . indexOf ( "viewall-" ) != - 1 ) ) {
244
+ var obj = JSON . stringify ( { "commentToggle" : "on" } ) ;
245
+ document . getElementById ( 'sg-viewport' ) . contentWindow . postMessage ( obj , annotationsViewer . targetOrigin ) ;
246
+ }
241
247
}
242
248
243
249
}
You can’t perform that action at this time.
0 commit comments