Skip to content

Commit

Permalink
Provide externalContainerSelector config in a different way
Browse files Browse the repository at this point in the history
Instead of override the window.hypothesisConfig, I provide the
`externalContainerSelector` through a JSON script tag. This allows a
more incremental way to add configuration options.
  • Loading branch information
esanzgar committed Oct 8, 2021
1 parent cc27c4d commit ba20635
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dev-server/documents/html/sidebar-external-container.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Sidebar in external container test</title>

<script type="application/json" class="js-hypothesis-config">
{
"externalContainerSelector": "#my-sidebar"
}
</script>

<style>
body {
font-family: sans-serif;
Expand Down Expand Up @@ -40,12 +47,5 @@
<iframe src="/document/injectable-frame" enable-annotation></iframe>
</div>
{{{hypothesisScript}}}
<script>
window.hypothesisConfig = function () {
return {
externalContainerSelector: '#my-sidebar',
};
};
</script>
</body>
</html>

0 comments on commit ba20635

Please sign in to comment.