-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jessica's Rolodex #23
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😆
@CheezItMan