This repository was archived by the owner on Feb 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,7 +110,9 @@ var annotationsPattern = {
110110
111111 var parentEl ;
112112
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" ) ) {
114116 return el . parentNode ;
115117 } else {
116118 parentEl = annotationsPattern . findParent ( el . parentNode ) ;
Original file line number Diff line number Diff line change 99var annotationsViewer = {
1010
1111 // 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 ,
1516
1617 /**
1718 * add the onclick handler to the annotations link in the main nav
@@ -238,6 +239,11 @@ var annotationsViewer = {
238239 return false ;
239240 }
240241 }
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+ }
241247 }
242248
243249 }
Original file line number Diff line number Diff line change @@ -110,7 +110,9 @@ var annotationsPattern = {
110110
111111 var parentEl ;
112112
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" ) ) {
114116 return el . parentNode ;
115117 } else {
116118 parentEl = annotationsPattern . findParent ( el . parentNode ) ;
Original file line number Diff line number Diff line change 99var annotationsViewer = {
1010
1111 // 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 ,
1516
1617 /**
1718 * add the onclick handler to the annotations link in the main nav
@@ -238,6 +239,11 @@ var annotationsViewer = {
238239 return false ;
239240 }
240241 }
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+ }
241247 }
242248
243249 }
You can’t perform that action at this time.
0 commit comments