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

Commit 22503bd

Browse files
committed
load annotations on "view-all" pages at load. turned off by default.
1 parent ff47154 commit 22503bd

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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)