Skip to content

Commit

Permalink
Open external playground in new tab
Browse files Browse the repository at this point in the history
  • Loading branch information
cyderize committed Jul 12, 2023
1 parent a72d6d9 commit 3beb086
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/lib/Playground.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
$: canCompile = busyState === 0 && currentSolver && (isModel || isData);
let hasRun = false;
$: splitterShowPanel = (!hideOutputOnStartup || hasRun) ? 'all' : 'a';
$: splitterShowPanel = !hideOutputOnStartup || hasRun ? 'all' : 'a';
let output = [];
let minizinc = null;
Expand Down Expand Up @@ -801,6 +801,12 @@
copiedShareUrl = true;
}
function openInExternalPlayground() {
if (externalPlaygroundURL) {
window.open(getShareUrl(externalPlaygroundURL), '_blank').focus();
}
}
let prevText = null;
async function checkCode(editor) {
const view = editor.view;
Expand Down Expand Up @@ -1073,12 +1079,7 @@
<button
class="button is-primary"
title="Open in playground"
on:click={() => {
window.location.href =
getShareUrl(
externalPlaygroundURL
);
}}
on:click={openInExternalPlayground}
>
<span class="icon">
<Fa
Expand Down

0 comments on commit 3beb086

Please sign in to comment.