mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-18 18:04:50 +02:00
Put sidebar trees under a root node.
This commit is contained in:
parent
e05d707918
commit
c6970505c7
5 changed files with 44 additions and 10 deletions
|
@ -204,6 +204,18 @@ final class TreeViewNode implements JsonSerializable
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setExpanded(?bool $selected): self
|
||||
{
|
||||
//Lazy loading of state, so it does not need to get serialized and transfered, when it is empty.
|
||||
if (null === $this->state) {
|
||||
$this->state = new TreeViewNodeState();
|
||||
}
|
||||
|
||||
$this->state->setExpanded(true);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTags(): ?array
|
||||
{
|
||||
return $this->tags;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue