mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 08:32:45 +08:00
UX: Close user card right away when navigating to a user.
This commit is contained in:
parent
b2a7411620
commit
72f7c26514
|
@ -103,6 +103,11 @@ export default Ember.Controller.extend({
|
|||
postStream.cancelFilter();
|
||||
postStream.refresh();
|
||||
this.close();
|
||||
},
|
||||
|
||||
showUser() {
|
||||
this.transitionToRoute('user', this.get('user'));
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
{{#if controller.visible}}
|
||||
<div class="card-content">
|
||||
{{#link-to 'user' user}}{{bound-avatar avatar "huge"}}{{/link-to}}
|
||||
|
||||
<a href {{action "showUser"}}>{{bound-avatar avatar "huge"}}</a>
|
||||
|
||||
<div class="names">
|
||||
<span>
|
||||
<h1 {{bind-attr class="staff new_user"}}>
|
||||
{{#link-to 'user' user}}{{username}} {{user-status user currentUser=currentUser}}{{/link-to}}
|
||||
<h1 class="{{staff}} {{new_user}}">
|
||||
<a href {{action "showUser"}}>{{username}} {{user-status user currentUser=currentUser}}</a>
|
||||
</h1>
|
||||
|
||||
{{#if user.name}}
|
||||
|
@ -17,7 +18,7 @@
|
|||
{{/if}}
|
||||
|
||||
{{#if showName}}
|
||||
<h2>{{#link-to 'user' user}}{{name}}{{/link-to}}</h2>
|
||||
<h2><a href {{Action "showUser"}}>{{name}}</a></h2>
|
||||
{{/if}}
|
||||
</span>
|
||||
</div>
|
||||
|
@ -28,15 +29,15 @@
|
|||
{{/if}}
|
||||
|
||||
{{#if showFilter}}
|
||||
<li><a class='btn' {{action "togglePosts" user}}>{{fa-icon "filter"}}{{i18n 'topic.filter_to' username=username post_count=topicPostCount}}</a></li>
|
||||
<li><a class='btn' href {{action "togglePosts" user}}>{{fa-icon "filter"}}{{i18n 'topic.filter_to' username=username post_count=topicPostCount}}</a></li>
|
||||
{{/if}}
|
||||
|
||||
{{#if hasUserFilters}}
|
||||
<li><a class='btn' {{action "cancelFilter"}}>{{fa-icon "times"}}{{i18n 'topic.filters.cancel'}}</a></li>
|
||||
<li><a class='btn' href {{action "cancelFilter"}}>{{fa-icon "times"}}{{i18n 'topic.filters.cancel'}}</a></li>
|
||||
{{/if}}
|
||||
|
||||
{{#if showDelete}}
|
||||
<li><a class='btn btn-danger' {{action "deleteUser" user}}>{{fa-icon "exclamation-triangle"}}{{i18n 'admin.user.delete'}}</a></li>
|
||||
<li><a class='btn btn-danger' href {{action "deleteUser" user}}>{{fa-icon "exclamation-triangle"}}{{i18n 'admin.user.delete'}}</a></li>
|
||||
{{/if}}
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -127,8 +127,7 @@ export default Discourse.View.extend(CleansUp, {
|
|||
_removeEvents: function() {
|
||||
$('html').off(clickOutsideEventName);
|
||||
|
||||
$('#main').off(clickDataExpand)
|
||||
.off(clickMention);
|
||||
$('#main').off(clickDataExpand).off(clickMention);
|
||||
|
||||
this.appEvents.off('usercard:shown', this, '_shown');
|
||||
}.on('willDestroyElement')
|
||||
|
|
Loading…
Reference in New Issue
Block a user