Skip to content

Jessica's Rolodex#23

Open
jchung722 wants to merge 9 commits intoAda-C6:masterfrom
jchung722:master
Open

Jessica's Rolodex#23
jchung722 wants to merge 9 commits intoAda-C6:masterfrom
jchung722:master

Conversation

@jchung722
Copy link

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jessica,

not bad at all, good work with edit & delete.

Just a note, we normally have views only concern themselves with code inside that view, so to find code inside the view we can use it's internal jQuery object.

el.$

Overall nicely done.

// el: $('#contact-cards'), <---still unsure why when el was specified (and direct li objects were added to ul tag), .contact-card tags could not be clicked independently
model: contact, //contacts created with each individual model passed through
});
this.listenTo(card, "deetsplz", this.makeDetail);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good use of Trigger.


addContact: function(contact) {
var card = new ContactView({
// el: $('#contact-cards'), <---still unsure why when el was specified (and direct li objects were added to ul tag), .contact-card tags could not be clicked independently

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because when el was specified each view was encompassing the same area on the DOM so any event was triggering all their listeners.

this.cardList.forEach(function(card) {
card.render();
$('#contact-cards').append(card.$el);
}, this);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be using el.$('#contact-cards').append, that way you're ensuring that the contact cards Id is within the view (el).

var filteredList = [];
for(var i = 0; i < this.cardList.length; i++) {
if(this.cardList[i].model == model) {
console.log("Found the bugger!");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants