Skip to content

Commit

Permalink
修复带锚点页面,目录地址错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft committed Oct 18, 2022
1 parent a3c80f8 commit 1a1d6d1
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions template/html/article.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,7 @@ function closeMenuRight()
<script>
document.title = '<?php echo $pageTitle; ?>';
var currentCatalog = <?php echo json_encode($currentCatalog, \JSON_THROW_ON_ERROR | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE); ?>;
if (location.hash.length > 0)
{
var url = currentCatalog.url.substr(0, currentCatalog.url.length - location.hash.length);
}
else
{
var url = currentCatalog.url;
}
var rootPath = location.pathname.substr(0, location.pathname.indexOf(url));
var rootPath = location.pathname.substr(0, location.pathname.indexOf(currentCatalog.url));
if('' === rootPath)
{
rootPath = location.pathname;
Expand Down

0 comments on commit 1a1d6d1

Please sign in to comment.