1
0
mirror of https://github.com/suk-ws/ph-Bookshelf.git synced 2024-12-05 01:16:53 +08:00

现在active父元素的折叠会自动展开

This commit is contained in:
A.C.Sukazyo Eyre 2021-04-28 14:17:56 +08:00
parent 2d608b6f2d
commit a7117c818e
Signed by: Eyre_S
GPG Key ID: EFB47D98FE082FAD
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ class BookCollection {
public function getHtml (): string {
$str = "";
if ($this->name != self::ROOT) $str .= "<li class='book-collection fold'><a class='book-collection' href='#'>$this->name<i class='exc-trigger fa'></i></a><ul class='book-collection summary'>";
if ($this->name != self::ROOT) $str .= "<li class='book-collection fold" . ($this->getBook(PageMeta::$book->getId())==null?"":"on") . "'><a class='book-collection' href='#'>$this->name<i class='exc-trigger fa'></i></a><ul class='book-collection summary'>";
foreach ($this->array as $node) {
$str .= $node->getHtml();
}

View File

@ -66,7 +66,7 @@ class Chapter {
public function getSummaryHtml (): string {
$str = "";
if ($this->parent != null) $str .= "<li class='chapter fold'><a class='page-chapter' href='#'>$this->name<i class='exc-trigger fa'></i></a><ul class='page-chapter summary'>";
if ($this->parent != null) $str .= "<li class='chapter fold" . ($this->getPage(PageMeta::$page->getId())==null?"":"on") . "'><a class='page-chapter' href='#'>$this->name<i class='exc-trigger fa'></i></a><ul class='page-chapter summary'>";
foreach ($this->childs as $node) {
$str .= $node->getSummaryHtml();
}