File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
core/webdoc-default-template/src/app/components/Explorer Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 1- export function isSamePage ( data ) {
2- const path = window . location . pathname . includes ( ".html" ) ?
3- window . location . pathname :
4- `${ window . location . pathname } .html` ;
1+ const paths = window . location . pathname . includes ( ".html" ) ?
2+ [ window . location . pathname ] :
3+ [
4+ `${ window . location . pathname } .html` ,
5+ `${ window . location . pathname } /index.html` . replace ( "//" , "/" ) ,
6+ ] ;
57
6- if ( data . page . startsWith ( "/" ) && data . page === path ) {
8+ export function isSamePage ( data ) {
9+ if ( data . page . startsWith ( "/" ) && paths . includes ( data . page ) ) {
710 return true ;
8- } else if ( ! data . page . startsWith ( "/" ) && path . includes ( `/${ data . page } ` ) ) {
11+ } else if ( ! data . page . startsWith ( "/" ) && paths . some ( ( path ) => path . includes ( `/${ data . page } ` ) ) ) {
912 return true ;
1013 }
1114
You can’t perform that action at this time.
0 commit comments