restore default avatars

This commit is contained in:
lilia 2015-01-14 01:37:41 -10:00
parent 1e4a7108e3
commit d119bdff01
2 changed files with 6 additions and 2 deletions

View file

@ -24,7 +24,6 @@
defaults: function() {
var timestamp = new Date().getTime();
return {
image : '/images/default.png',
unreadCount : 0,
timestamp : timestamp,
active_at : timestamp
@ -36,7 +35,7 @@
},
validate: function(attributes, options) {
var required = ['type', 'timestamp', 'image'];
var required = ['type', 'timestamp'];
var missing = _.filter(required, function(attr) { return !attributes[attr]; });
if (missing.length) { return "Conversation must have " + missing; }
},

View file

@ -41,6 +41,11 @@ var Whisper = Whisper || {};
new Whisper.AttachmentView({model: this.model.get('avatar')}).render().el
);
}
else {
this.$el.find('.avatar').append(
$('<img>').attr('src', '/images/default.png')
);
}
return this;
}