MCPcopy Create free account
hub / github.com/cutedCha/noteBoook / showTableOfContents

Function showTableOfContents

js/app.js:1205–1229  ·  view source on GitHub ↗

* 显示目录

()

Source from the content-addressed store, hash-verified

1203 * 显示目录
1204 */
1205function showTableOfContents() {
1206 console.log('showTableOfContents 被调用');
1207 AppState.currentView = 'toc';
1208
1209 // 隐藏封面,显示目录
1210 if (Elements.cover) {
1211 console.log('隐藏封面');
1212 Elements.cover.classList.add('hidden');
1213 }
1214 if (Elements.toc) {
1215 console.log('显示目录, Elements.toc:', Elements.toc);
1216 Elements.toc.classList.remove('hidden');
1217 // 渲染目录内容(如果尚未渲染)
1218 console.log('准备调用 renderTableOfContents');
1219 renderTableOfContents();
1220 } else {
1221 console.error('Elements.toc 不存在!');
1222 }
1223 if (Elements.content) {
1224 Elements.content.classList.add('hidden');
1225 }
1226 if (Elements.navigation) {
1227 Elements.navigation.classList.add('hidden');
1228 }
1229}
1230
1231/**
1232 * 渲染目录内容

Callers 4

book.jsFile · 0.85
navigation.jsFile · 0.85
handleEnterClickFunction · 0.85
handleContinueReadingFunction · 0.85

Calls 1

renderTableOfContentsFunction · 0.85

Tested by

no test coverage detected