Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 1, 2023
1 parent e85d315 commit 22f995a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Bridges/ApplicationLatte/Nodes/ControlNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function print(PrintContext $context): string

$fetchCode .= $this->inSnippetArea
? 'if ($ʟ_tmp instanceof Nette\Application\UI\Renderable) $ʟ_tmp->snippetMode = $this->global->uiControl->snippetMode;'
: 'if ($ʟ_tmp instanceof Nette\Application\UI\Renderable) $ʟ_tmp->redrawControl(null, $ʟ_tmp->snippetMode = false);';
: 'if ($ʟ_tmp instanceof Nette\Application\UI\Renderable) $ʟ_tmp->redrawControl(null, false);';

if ($this->escape) {
return $context->format(
Expand Down
7 changes: 4 additions & 3 deletions src/Bridges/ApplicationLatte/SnippetRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public function enter(string $name, string $type): void
$this->nestingLevel++;
}

$this->stack[] = [$name, $obStarted];
$this->stack[] = [$name, $obStarted, $this->control->snippetMode];
$this->control->snippetMode = false;
if ($name !== '') {
$this->control->redrawControl($name, false);
}
Expand All @@ -78,7 +79,7 @@ public function leave(): void
return;
}

[$name, $obStarted] = array_pop($this->stack);
[$name, $obStarted, $this->control->snippetMode] = array_pop($this->stack);
if ($this->nestingLevel > 0 && --$this->nestingLevel === 0) {
$content = ob_get_clean();
$this->payload ??= $this->control->getPresenter()->getPayload();
Expand Down Expand Up @@ -114,9 +115,9 @@ public function renderSnippets(array $blocks, array $params): bool

$function = reset($block->functions);
$function($params);
$this->control->redrawControl($name, false);
}

$this->control->redrawControl(null, false);
$this->renderChildren();
return true;
}
Expand Down

0 comments on commit 22f995a

Please sign in to comment.