Skip to content
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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Jessica's Rolodex #23

wants to merge 9 commits into from

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