aboutsummaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'main.js')
-rw-r--r--main.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.js b/main.js
index 8bc647f..741e39c 100644
--- a/main.js
+++ b/main.js
@@ -70,7 +70,8 @@ function renderView(path, choice) {
e.querySelector("a").href = path? `#/${path}/edit` : "#/edit";
e.querySelector("h2").innerHTML = path? (page.paths.length? `#${pageid} / ` +
- page.paths.map(p => `<a href="#/${p}"${p==path?' class="active"':""}>${p}</a>`).join(" / ") : "UNREACHABLE") : "Start";
+ page.paths.map(p => `<a href="#/${p}"${p==path?' class="active"':""}>${p}</a>`)
+ .join(" / ") : "UNREACHABLE") : "<a href='#/'>Start</a>";
e.innerHTML += markup(page.body);
if (!page.choices.length) e.innerHTML += "<h3 id='the-end'></h3>";
else if (choice) e.innerHTML += `<a class="choice-made" href="#/${path}">${markup(page.choices[choice-1][1])}</a>`;
@@ -89,7 +90,8 @@ function renderEdit(path) {
e.classList.add("editing");
e.querySelector("a").href = `#/${path}`;
e.querySelector("h2").innerHTML = path? (page.paths.length? `#${pageid} / ` +
- page.paths.map(p => `<a href="#/${p}"${p==path?' class="active"':""}>${p}</a>`).join(" / ") : "UNREACHABLE") : "Start";
+ page.paths.map(p => `<a href="#/${p}"${p==path?' class="active"':""}>${p}</a>`)
+ .join(" / ") : "UNREACHABLE") : "<a href='#/'>Start</a>";
e.querySelector("textarea").value = page.body;
page.choices.forEach(c => {