This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/poster-avatar.js.es6
Sam 9c81f2c6af remove duplicate code
fix issue where clicking on
the same user in 2 locations on the page would not work correctly

centralize logic
2014-11-06 12:13:46 +11:00

13 lines
401 B
JavaScript

export default Ember.Component.extend({
tagName: 'a',
attributeBindings: ['href','data-user-card'],
classNames: ['trigger-user-card'],
href: Em.computed.oneWay('post.usernameUrl'),
"data-user-card": Em.computed.oneWay('post.username'),
render: function(buffer) {
var avatar = Handlebars.helpers.avatar(this.get('post'), {hash: {imageSize: 'large'}});
buffer.push(avatar);
}
});