Skip to content

Commit bd277db

Browse files
committed
Fix code Open in REPL.
Reviewed by @tolmasky.
1 parent e4a6dfe commit bd277db

6 files changed

Lines changed: 502 additions & 500 deletions

File tree

0.24.1/docs/index.html

Lines changed: 246 additions & 246 deletions
Large diffs are not rendered by default.

0.24.1/docs/index.html.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
{{/if}}
154154

155155
{{#if example}}
156-
<pre><div class = "try-repl" ><button class = "send-repl" data-ramda-version="{{@root.version}}">Send to REPL</button><button class = "run-here" data-ramda-version="{{@root.version}}">Run it here</button></div><code class="hljs javascript">{{{example}}}</code></pre>
156+
<pre><div class = "try-repl" ><button class = "send-repl" data-ramda-version="{{@root.version}}">Open in REPL</button><button class = "run-here" data-ramda-version="{{@root.version}}">Run it here</button></div><code class="hljs javascript">{{{example}}}</code></pre>
157157
{{/if}}
158158
</section>
159159
{{/each}}

0.24.1/docs/main.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,20 @@
106106
return;
107107
}
108108

109+
var codeElement = target.parentNode.nextElementSibling;
110+
109111
if (isREPL || !window.RunKit) {
110112
var version = event.target.dataset && event.target.dataset.ramdaVersion;
111113
var versionParam = version ? '?v=' + version : '';
112-
var code = event.target.nextElementSibling.textContent;
114+
var code = codeElement.textContent;
113115
var encoded = fixedEncodeURIComponent(code);
114-
116+
115117
return window.open(location.origin + '/repl/' +
116118
versionParam + '#;' + encoded);
117119
}
118120

119121
var parent = target.parentNode.parentNode;
120122
var ramdaVersion = target.dataset && "@" + target.dataset.ramdaVersion || "";
121-
var codeElement = target.parentNode.nextElementSibling;
122123

123124
parent.style.background = "transparent";
124125
parent.style.overflow = "hidden";

0 commit comments

Comments
 (0)