Skip to content

Commit 1847dba

Browse files
commit
1 parent b2e3fed commit 1847dba

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

bible/index.html

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<link rel="stylesheet" href="styles.css">
88
</head>
99
<body>
10-
<!-- Mobile menu button -->
1110
<button id="mobile-menu" aria-label="Toggle menu"></button>
1211

1312
<div class="container">
@@ -19,12 +18,11 @@ <h2>Books</h2>
1918

2019
<!-- Right Content Area -->
2120
<main class="main-content">
22-
<div class="chapter-nav">
23-
<button id="prevChapter" aria-label="Previous chapter">&lt;</button>
24-
<div class="chapters-wrapper">
25-
<div id="chapter-numbers" class="chapter-numbers"></div>
26-
</div>
27-
<button id="nextChapter" aria-label="Next chapter">&gt;</button>
21+
<!-- Add this navigation element -->
22+
<div id="navigation" style="display: none;">
23+
<button id="prevChapter">&lt;</button>
24+
<div id="chapter-numbers"></div>
25+
<button id="nextChapter">&gt;</button>
2826
</div>
2927
<article id="verses"></article>
3028
</main>

bible/script.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,22 @@ async function loadBook(bookFile) {
5959
try {
6060
bookData = await loadBookData(bookFile);
6161
if (!bookData) throw new Error('No book data received');
62-
62+
6363
currentBook = Object.keys(bookData)[0];
64-
currentChapter = '1'; // Force first chapter
65-
66-
if (!bookData[currentBook][currentChapter]) {
67-
currentChapter = Object.keys(bookData[currentBook])[0];
68-
}
64+
currentChapter = '1';
6965

66+
// Check if navigation element exists
67+
const navElement = document.getElementById('navigation');
68+
if (!navElement) throw new Error('Navigation element not found');
69+
70+
navElement.style.display = 'flex'; // Now safe to modify
7071
updateChapterNavigation();
7172
loadChapter(currentChapter);
72-
document.getElementById('navigation').style.display = 'flex';
7373

7474
} catch (error) {
7575
console.error("Book load failed:", error);
7676
document.getElementById('verses').innerHTML =
77-
`<p class="error">Error loading book. Please try again.</p>`;
77+
`<p class="error">${error.message}</p>`;
7878
}
7979
}
8080

0 commit comments

Comments
 (0)