mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 04:59:21 +03:00
Underscore.js _.each() to native Array.forEach() (optional with Object.entries/values)
This commit is contained in:
parent
178e5f6ef7
commit
a5d41edb24
25 changed files with 72 additions and 79 deletions
|
|
@ -301,7 +301,7 @@ class ContactsPopupView extends AbstractViewNext {
|
|||
const requestUid = fakeMd5(),
|
||||
properties = [];
|
||||
|
||||
_.each(this.viewProperties(), (oItem) => {
|
||||
this.viewProperties().forEach(oItem => {
|
||||
if (oItem.type() && oItem.type() !== ContactPropertyType.FullName && '' !== trim(oItem.value())) {
|
||||
properties.push([oItem.type(), oItem.value(), oItem.typeStr()]);
|
||||
}
|
||||
|
|
@ -456,7 +456,7 @@ class ContactsPopupView extends AbstractViewNext {
|
|||
count = this.contacts().length;
|
||||
|
||||
if (0 < contacts.length) {
|
||||
_.each(contacts, (contact) => {
|
||||
contacts.forEach(contact => {
|
||||
if (currentContact && currentContact.idContact === contact.idContact) {
|
||||
currentContact = null;
|
||||
this.currentContact(null);
|
||||
|
|
@ -471,7 +471,7 @@ class ContactsPopupView extends AbstractViewNext {
|
|||
}
|
||||
|
||||
_.delay(() => {
|
||||
_.each(contacts, (contact) => {
|
||||
contacts.forEach(contact => {
|
||||
koContacts.remove(contact);
|
||||
delegateRunOnDestroy(contact);
|
||||
});
|
||||
|
|
@ -523,7 +523,7 @@ class ContactsPopupView extends AbstractViewNext {
|
|||
if (contact) {
|
||||
id = contact.idContact;
|
||||
if (isNonEmptyArray(contact.properties)) {
|
||||
_.each(contact.properties, (property) => {
|
||||
contact.properties.forEach(property => {
|
||||
if (property && property[0]) {
|
||||
if (ContactPropertyType.LastName === property[0]) {
|
||||
lastName = property[1];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue