mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 11:48:49 +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;
|
||||
|
|
|
@ -66,9 +66,10 @@ final class TreeViewNodeState implements JsonSerializable
|
|||
return $this->disabled;
|
||||
}
|
||||
|
||||
public function setDisabled(?bool $disabled): void
|
||||
public function setDisabled(?bool $disabled): self
|
||||
{
|
||||
$this->disabled = $disabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getExpanded(): ?bool
|
||||
|
@ -76,9 +77,10 @@ final class TreeViewNodeState implements JsonSerializable
|
|||
return $this->expanded;
|
||||
}
|
||||
|
||||
public function setExpanded(?bool $expanded): void
|
||||
public function setExpanded(?bool $expanded): self
|
||||
{
|
||||
$this->expanded = $expanded;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSelected(): ?bool
|
||||
|
@ -86,9 +88,10 @@ final class TreeViewNodeState implements JsonSerializable
|
|||
return $this->selected;
|
||||
}
|
||||
|
||||
public function setSelected(?bool $selected): void
|
||||
public function setSelected(?bool $selected): self
|
||||
{
|
||||
$this->selected = $selected;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function jsonSerialize()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue