Skip to content

Commit b558acf

Browse files
committed
update the list
1 parent 05f1fe2 commit b558acf

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

layouts/learn/list.html

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ <h3>{{ .Title }}</h3>
8383

8484
if (!courseLinks.length) return;
8585

86+
// パンくずリストから現在のページがLearnページかどうかを判断
87+
const breadcrumbs = document.querySelector('.breadcrumb');
88+
const lastBreadcrumb = breadcrumbs ? breadcrumbs.lastElementChild : null;
89+
const isLearnPage = lastBreadcrumb &&
90+
(lastBreadcrumb.textContent.trim() === 'Learn' ||
91+
lastBreadcrumb.textContent.trim() === 'Learning Path');
92+
8693
// コンテンツを取得して表示する関数
8794
async function fetchAndDisplayContent(url, container) {
8895
try {
@@ -129,19 +136,8 @@ <h3>{{ .Title }}</h3>
129136

130137
courseLinks.forEach(link => {
131138
link.addEventListener('click', async function(e) {
132-
if (isMobile) return; // モバイルの場合は通常の遷移
133-
134-
// パンくずリストの最新部分を取得
135-
const breadcrumbs = document.querySelector('.breadcrumb');
136-
const lastBreadcrumb = breadcrumbs ? breadcrumbs.lastElementChild : null;
137-
const isListPage = lastBreadcrumb && lastBreadcrumb.textContent.trim() === 'Learning Path';
138-
const targetType = this.getAttribute('data-type');
139+
if (isMobile || isLearnPage) return; // モバイルまたはLearnページの場合は通常の遷移
139140

140-
// list → list の遷移の場合は通常の遷移を行う
141-
if (isListPage && targetType === 'section') {
142-
return;
143-
}
144-
145141
e.preventDefault();
146142
const url = this.getAttribute('data-course-link');
147143
const wrapper = this.closest('.course-wrapper');

0 commit comments

Comments
 (0)