File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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' ) ;
You can’t perform that action at this time.
0 commit comments