Supress change event on avatarUrl initialization

This commit is contained in:
lilia 2015-06-09 12:03:28 -07:00
parent ac401c78b3
commit 9795b26bc1

View file

@ -222,7 +222,7 @@
} }
}, },
updateAvatarUrl: function() { updateAvatarUrl: function(silent) {
this.revokeAvatarUrl(); this.revokeAvatarUrl();
var avatar = this.get('avatar'); var avatar = this.get('avatar');
if (avatar) { if (avatar) {
@ -232,12 +232,14 @@
} else { } else {
this.avatarUrl = null; this.avatarUrl = null;
} }
this.trigger('change'); if (!silent) {
this.trigger('change');
}
}, },
getAvatarUrl: function() { getAvatarUrl: function() {
if (this.avatarUrl === undefined) { if (this.avatarUrl === undefined) {
this.updateAvatarUrl(); this.updateAvatarUrl(true);
} }
return this.avatarUrl || '/images/default.png'; return this.avatarUrl || '/images/default.png';
}, },