restore default avatars
This commit is contained in:
parent
1e4a7108e3
commit
d119bdff01
2 changed files with 6 additions and 2 deletions
|
@ -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; }
|
||||
},
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue