Skip to content

Commit

Permalink
save/restore initial list showTree config value
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Oct 11, 2023
1 parent 751545f commit d385851
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions modules/backend/widgets/Lists.php
Original file line number Diff line number Diff line change
Expand Up @@ -1489,10 +1489,19 @@ public function addFilter(callable $filter)
public function setSearchTerm($term, $resetPagination = false)
{
if (
strlen($this->searchTerm) !== 0
&& trim($this->searchTerm) !== ''
strlen($term) !== 0
&& trim($term) !== ''
) {
if ($this->showTree === true) {
// save initial list config showTree value
$this->putSession('showTree', true);
}
$this->showTree = false;
} else {
if ($this->getSession('showTree')) {
// restore initial list config showTree value
$this->showTree = true;
}
}

if ($resetPagination) {
Expand Down

0 comments on commit d385851

Please sign in to comment.