Skip to content

Commit 8423aeb

Browse files
authored
Automaticaly invalidate snippetArea on ajax
1 parent 1a5393e commit 8423aeb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Infinityloop/LazyComponent/LazyComponent.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ public function render() : void
3131

3232
$this->template->render();
3333
}
34+
35+
public function redrawControl(string $snippet = null, bool $redraw = true): void
36+
{
37+
if (\is_string($snippet) && !\Nette\Utils\Strings::startsWith($snippet, 'lazyComponent_')) {
38+
$this->redrawControl('lazyComponent_snippetArea');
39+
}
40+
41+
parent::redrawControl($snippet, $redraw);
42+
}
3443

3544
public function saveState(array &$params): void
3645
{

0 commit comments

Comments
 (0)