Skip to content

Commit

Permalink
Filter invalid entries from simple lists
Browse files Browse the repository at this point in the history
  • Loading branch information
philikon committed Nov 15, 2011
1 parent c926281 commit cda7139
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion addressbook.js
Expand Up @@ -260,7 +260,17 @@ let AB = {
}
field.disabled = true;
}
//TODO filter arrays

// Filter invalid entries from list.
SIMPLE_LIST_FIELDS.forEach(function (field) {
let list = record[field];
if (!list) {
return;
}
record[field] = list.filter(function (entry) {
return entry.value;
});
});

//TODO this is a locale setting
record.displayName = record.name.givenName + " " + record.name.familyName;
Expand Down

0 comments on commit cda7139

Please sign in to comment.