Put sidebar trees under a root node.

This commit is contained in:
Jan Böhmer 2020-10-03 13:56:30 +02:00
parent e05d707918
commit c6970505c7
5 changed files with 44 additions and 10 deletions

View file

@ -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;