diff --git a/cake/libs/view/helpers/javascript.php b/cake/libs/view/helpers/javascript.php index 316786e20..aa74b0ae4 100644 --- a/cake/libs/view/helpers/javascript.php +++ b/cake/libs/view/helpers/javascript.php @@ -269,7 +269,8 @@ class JavascriptHelper extends AppHelper { $this->_cachedEvents = array(); if (!empty($rules)) { - $data .= "\nEventSelectors.start({\n" . implode(",\n\n", $rules) . "\n});\n"; + $data .= "\nvar Rules = {\n" . implode(",\n\n", $rules) . "\n}"; + $data .= "\nEventSelectors.start(Rules);\n"; } if (!empty($events) || !empty($rules)) {