Fix for validator results tomfoolery

The `description` field of a validation message is now `null` if there
is no description for the message (for consistency). No need for such
strict type restrictions; a falsey value is an empty description
always.
This commit is contained in:
Matt Basta 2012-11-14 11:04:06 -08:00
Родитель 238be139bc
Коммит 9a5a2eb284
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -197,7 +197,7 @@ function initValidator($doc) {
msgDiv.attr('id', 'v-msg-' + msg.uid);
msgDiv.addClass('msg-' + effectiveType);
$('h5', msgDiv).html(msg.message);
if (typeof(msg.description) === 'undefined' || msg.description === '') {
if (!msg.description) {
msg.description = [];
} else if (typeof(msg.description) === 'string') {
// Currently it can be either of these: