Middle clicking the avatar should go to profile

This commit is contained in:
Robin Ward 2015-09-03 11:53:42 -04:00
parent 12e0225c51
commit 7516643f11
3 changed files with 8 additions and 7 deletions

View File

@ -1,7 +1,14 @@
import computed from 'ember-addons/ember-computed-decorators';
export default Ember.Component.extend({
tagName: 'li',
classNameBindings: [':header-dropdown-toggle', 'active'],
@computed('showUser')
href(showUser) {
return showUser ? this.currentUser.get('path') : '';
},
active: Ember.computed.alias('toggleVisible'),
actions: {

View File

@ -60,12 +60,6 @@ const User = RestModel.extend({
return ('background-image: url(' + Discourse.getURLWithCDN(bgUrl) + ')').htmlSafe();
},
/**
Path to this user.
@property path
@type {String}
**/
path: function(){
return Discourse.getURL('/users/' + this.get('username_lower'));
// no need to observe, requires a hard refresh to update

View File

@ -1,4 +1,4 @@
<a {{action "toggle"}} class='icon' href title={{i18n title}} aria-label={{i18n title}} id={{iconId}}>
<a {{action "toggle"}} class='icon' href={{href}} title={{i18n title}} aria-label={{i18n title}} id={{iconId}}>
{{#if showUser}}
{{bound-avatar currentUser "medium"}}
{{else}}