Skip to content

Commit

Permalink
Save / Restore initial list showTree config value (#987)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin authored Oct 14, 2023
1 parent f986a56 commit 8f7c656
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 8f7c656

Please sign in to comment.