Skip to content

Commit

Permalink
Update JsUtils.php
Browse files Browse the repository at this point in the history
  • Loading branch information
jcheron committed Nov 12, 2021
1 parent d0ec95f commit 4e9ce41
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Ajax/JsUtils.php
Expand Up @@ -359,18 +359,19 @@ public function compile(&$view = NULL, $view_var = 'script_foot', $script_tags =
* @return void
*/
public function clear_compile() {
$this->jquery_code_for_compile = array();
$this->jquery_code_for_compile = $this->jquery_code_for_compile_at_last = [];
}

public function getScript($offset = 0) {
$code = $this->jquery_code_for_compile;
if ($offset > 0)
$code = \array_merge($this->jquery_code_for_compile, $this->jquery_code_for_compile_at_last);
if ($offset > 0) {
$code = \array_slice($code, $offset);
return implode('', $code);
}
return \implode('', $code);
}

public function scriptCount() {
return \sizeof($this->jquery_code_for_compile);
return \count($this->jquery_code_for_compile);
}

/**
Expand Down

0 comments on commit 4e9ce41

Please sign in to comment.