Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 9b9bf6a

Browse files
committed
making sure the core has the annotations fix
1 parent 9f01a63 commit 9b9bf6a

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

core/styleguide/js/annotations-pattern.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,19 @@ var annotationsPattern = {
3737
els[i].onclick = (function(item) {
3838
return function(e) {
3939

40-
e.preventDefault();
41-
e.stopPropagation();
42-
var obj = {};
43-
44-
// if an element was clicked on while the overlay was already on swap it
45-
obj = { "displaynumber": item.displaynumber, "el": item.el, "title": item.title, "comment": item.comment };
46-
47-
var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host;
48-
parent.postMessage(obj,targetOrigin);
40+
if (annotationsPattern.commentsOverlayActive) {
41+
42+
e.preventDefault();
43+
e.stopPropagation();
44+
var obj = {};
45+
46+
// if an element was clicked on while the overlay was already on swap it
47+
obj = { "displaynumber": item.displaynumber, "el": item.el, "title": item.title, "comment": item.comment };
48+
49+
var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host;
50+
parent.postMessage(obj,targetOrigin);
51+
52+
}
4953

5054
}
5155
})(item);

0 commit comments

Comments
 (0)