diff options
author | Adam Hovorka <[email protected]> | 2020-04-24 21:53:27 -0600 |
---|---|---|
committer | Adam Hovorka <[email protected]> | 2020-04-24 21:53:27 -0600 |
commit | 06478d0c8a98eaeb1ddc431943634361ca251e75 (patch) | |
tree | 73836c49cd467ddb6caf462270b686834adde9ba /main.js | |
parent | 576f66fa96906992791f84d0dfaed697c1bd80f1 (diff) |
Make the Start header a link
Diffstat (limited to 'main.js')
-rw-r--r-- | main.js | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 => { |