diff --git a/bindings/wasm/examples/editor.js b/bindings/wasm/examples/editor.js index 123715e0c..64c066d5b 100644 --- a/bindings/wasm/examples/editor.js +++ b/bindings/wasm/examples/editor.js @@ -112,6 +112,8 @@ function switchTo(scriptName) { isExample = exampleFunctions.get(scriptName) != null; const code = isExample ? exampleFunctions.get(scriptName).substring(1) : getScript(scriptName) ?? ''; + window.location.hash = `#${scriptName}`; + window.location.search = ''; editor.setValue(code); } } @@ -129,8 +131,6 @@ function createDropdownItem(name) { button.onclick = function() { saveCurrent(); - window.location.hash = `#${label.textContent}`; - window.location.search = ''; switchTo(label.textContent); }; // Stop text input spaces from triggering the button @@ -217,7 +217,6 @@ function addEdit(button) { removeScript(label.textContent); if (currentFileElement.textContent == label.textContent) { switchTo('Intro'); - window.location.hash = '#Intro'; } const container = button.parentElement; container.parentElement.removeChild(container); @@ -332,6 +331,8 @@ require(['vs/editor/editor.main'], async function() { else { switchTo(name); } + } else { + switchTo(currentName); } if (manifoldInitialized) { diff --git a/bindings/wasm/examples/index.html b/bindings/wasm/examples/index.html index eaf74bf65..87b3434c3 100644 --- a/bindings/wasm/examples/index.html +++ b/bindings/wasm/examples/index.html @@ -73,7 +73,7 @@
+ shadow-intensity="1" tone-mapping="commerce" interaction-prompt="none" alt="Editor 3D output">

Loading...

@@ -95,6 +95,6 @@ integrity="sha512-iQEIc0rsSDujsfjtD+lfyJ1W23Bh/lbgriubKDAym6VlEIDRj9rrbSIyJRyshOrl8s0yRcQ0+gyrZfSLyjJGWQ==" crossorigin="anonymous" referrerpolicy="no-referrer"> - + \ No newline at end of file diff --git a/bindings/wasm/examples/make-manifold.html b/bindings/wasm/examples/make-manifold.html index d46f7a3cb..e9856bde7 100644 --- a/bindings/wasm/examples/make-manifold.html +++ b/bindings/wasm/examples/make-manifold.html @@ -55,11 +55,11 @@ - + Drop a GLB here - + +