Fixes checking for $.inArray() result in docs [skip ci]

See http://stackoverflow.com/questions/5304458/jquery-inarray-only-looking-at-first-value
This commit is contained in:
BooleanType
2015-10-23 20:11:25 +03:00
committed by Alexander Makarov
parent fb59d304f5
commit 8a3babc9ef

View File

@@ -544,7 +544,7 @@ class StatusValidator extends Validator
$statuses = json_encode(Status::find()->select('id')->asArray()->column()); $statuses = json_encode(Status::find()->select('id')->asArray()->column());
$message = json_encode($this->message, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); $message = json_encode($this->message, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
return <<<JS return <<<JS
if (!$.inArray(value, $statuses)) { if ($.inArray(value, $statuses) > -1) {
messages.push($message); messages.push($message);
} }
JS; JS;