Closed yongzhenlow closed 11 years ago
addJs var is initialized with:
// &addJs - [ 0 | 1 | 2 ]
$addJs = (int) $this->modx->getOption('addJs', $this->config, 1);
$this->config['addJs'] = ($addJs == 0 || $addJs == 1 || $addJs == 2) ? $addJs : 1;
inside _checkParams function prior to use it.
@Coroico I think you misunderstand. If the user disables js with &addJS=
0`, the browser will throw error
advsea is undefined`. That's what this patch is for.
(PS: i removed the branch, that's why the pull request was closed. Let me know if you want me to send again.)
Added conditional so that if user chose 0 for addJs, inline js would not be output. This is because advsea var was not initialized as the prior js files were not loaded.
I've also added the js to check advsea for undefined as an extra measure, since this would be prove useful if your intentions were to allow access to these vars even if addJs was 0. In that case, you can remove my first change, while keeping the js.