File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -47,15 +47,17 @@ if (self != top) {
47
47
} ;
48
48
}
49
49
50
+ // if there are clicks on the iframe make sure the nav in the iframe parent closes
51
+ var body = document . getElementsByTagName ( 'body' ) ;
52
+ body [ 0 ] . onclick = function ( ) {
53
+ var targetOrigin = ( window . location . protocol == "file:" ) ? "*" : window . location . protocol + "//" + window . location . host ;
54
+ var obj = JSON . stringify ( { "event" : "patternLab.bodyClick" , "bodyclick" : "bodyclick" } ) ;
55
+ parent . postMessage ( obj , targetOrigin ) ;
56
+ } ;
57
+
50
58
}
51
59
52
- // if there are clicks on the iframe make sure the nav in the iframe parent closes
53
- var body = document . getElementsByTagName ( 'body' ) ;
54
- body [ 0 ] . onclick = function ( ) {
55
- var targetOrigin = ( window . location . protocol == "file:" ) ? "*" : window . location . protocol + "//" + window . location . host ;
56
- var obj = JSON . stringify ( { "event" : "patternLab.bodyClick" , "bodyclick" : "bodyclick" } ) ;
57
- parent . postMessage ( obj , targetOrigin ) ;
58
- } ;
60
+
59
61
60
62
// watch the iframe source so that it can be sent back to everyone else.
61
63
function receiveIframeMessage ( event ) {
Original file line number Diff line number Diff line change 575
575
576
576
if ( data . event !== undefined ) {
577
577
578
- if ( data . event == "patternLab.bodyclick " ) {
578
+ if ( data . event == "patternLab.bodyClick " ) {
579
579
580
580
closePanels ( ) ;
581
581
You can’t perform that action at this time.
0 commit comments