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

Commit 366f988

Browse files
committed
Merge branch 'master' into dev
2 parents 3aa5954 + 7fd37fe commit 366f988

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

core/styleguide/js/annotations-pattern.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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);

core/styleguide/js/annotations-viewer.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
var 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
}

public/styleguide/js/annotations-pattern.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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);

public/styleguide/js/annotations-viewer.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
var 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
}

0 commit comments

Comments
 (0)