Middle clicking the avatar should go to profile
This commit is contained in:
parent
12e0225c51
commit
7516643f11
|
@ -1,7 +1,14 @@
|
||||||
|
import computed from 'ember-addons/ember-computed-decorators';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
tagName: 'li',
|
tagName: 'li',
|
||||||
classNameBindings: [':header-dropdown-toggle', 'active'],
|
classNameBindings: [':header-dropdown-toggle', 'active'],
|
||||||
|
|
||||||
|
@computed('showUser')
|
||||||
|
href(showUser) {
|
||||||
|
return showUser ? this.currentUser.get('path') : '';
|
||||||
|
},
|
||||||
|
|
||||||
active: Ember.computed.alias('toggleVisible'),
|
active: Ember.computed.alias('toggleVisible'),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -60,12 +60,6 @@ const User = RestModel.extend({
|
||||||
return ('background-image: url(' + Discourse.getURLWithCDN(bgUrl) + ')').htmlSafe();
|
return ('background-image: url(' + Discourse.getURLWithCDN(bgUrl) + ')').htmlSafe();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
Path to this user.
|
|
||||||
|
|
||||||
@property path
|
|
||||||
@type {String}
|
|
||||||
**/
|
|
||||||
path: function(){
|
path: function(){
|
||||||
return Discourse.getURL('/users/' + this.get('username_lower'));
|
return Discourse.getURL('/users/' + this.get('username_lower'));
|
||||||
// no need to observe, requires a hard refresh to update
|
// no need to observe, requires a hard refresh to update
|
||||||
|
|
|
@ -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}}
|
{{#if showUser}}
|
||||||
{{bound-avatar currentUser "medium"}}
|
{{bound-avatar currentUser "medium"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
|
Loading…
Reference in New Issue