diff options
-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 => { |