on master help sign in
use postMessage to tell creator of <iframe> to "Jump to Problem"
commit71a5a82cbf12c2d8cc38c299236d6d726635b57f authorEvan Czaplicki <evancz@users.noreply.github.com> dateFri 11 Oct 2019, 13:01 (7 years ago) parent1e9d2f3
1 file changed+6−1
worker/src/Endpoint/Compile.hs+6−1
worker/src/Endpoint/Compile.hs+6−1
@@ -176,7 +176,12 @@ renderReport report =
176176 <script src="https://worker.elm-lang.org/compile/errors.js"></script>
177177</head>
178178<body>
179− <script>Elm.Errors.init({flags:|] <> Encode.encodeUgly (Exit.toJson report) <> [r|});</script>
179+ <script>
180+ var app = Elm.Errors.init({flags:|] <> Encode.encodeUgly (Exit.toJson report) <> [r|});
181+ app.ports.jumpTo.subscribe(function(region) {
182+ window.parent.postMessage(JSON.stringify(region), '*');
183+ });
184+ </script>
180185</body>
181186</html>|]
182187