mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
23 lines
No EOL
593 B
JavaScript
23 lines
No EOL
593 B
JavaScript
NEWSBLUR.Models.User = Backbone.Model.extend({
|
|
|
|
idAttribute: 'user_id',
|
|
|
|
get: function(attr) {
|
|
var value = Backbone.Model.prototype.get.call(this, attr);
|
|
if (attr == 'photo_url' && !value) {
|
|
value = NEWSBLUR.Globals.MEDIA_URL + 'img/reader/default_profile_photo.png';
|
|
}
|
|
return value;
|
|
}
|
|
|
|
});
|
|
|
|
NEWSBLUR.Collections.Users = Backbone.Collection.extend({
|
|
|
|
model : NEWSBLUR.Models.User,
|
|
|
|
find: function(user_id) {
|
|
return this.detect(function(user) { return user.get('user_id') == user_id; });
|
|
}
|
|
|
|
}); |