mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Prevent JsHelper::writeBuffer() to return empty lines (or empty onDomReady events)
Signed-off-by: Mark Story <mark@mark-story.com>
This commit is contained in:
parent
0bc1126114
commit
2d9b13fe88
1 changed files with 4 additions and 0 deletions
|
@ -196,6 +196,10 @@ class JsHelper extends AppHelper {
|
|||
$options = array_merge($defaults, $options);
|
||||
$script = implode("\n", $this->getBuffer($options['clear']));
|
||||
|
||||
if (empty($script)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($options['onDomReady']) {
|
||||
$script = $this->{$this->__engineName}->domReady($script);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue