FIX: Do not reload card if already loaded (#14129)
This changes include some used for making it easier to extend user card functionality.
This commit is contained in:
parent
dfeca42bf8
commit
5e8a42e55b
|
@ -39,7 +39,7 @@ export default Mixin.create({
|
|||
isFixed: false,
|
||||
isDocked: false,
|
||||
|
||||
_show(username, target) {
|
||||
_show(username, target, event) {
|
||||
// No user card for anon
|
||||
if (this.siteSettings.hide_user_profiles_from_public && !this.currentUser) {
|
||||
return false;
|
||||
|
@ -54,8 +54,11 @@ export default Mixin.create({
|
|||
return false;
|
||||
}
|
||||
|
||||
this.set("lastEvent", event);
|
||||
|
||||
const currentUsername = this.username;
|
||||
if (username === currentUsername && this.loading === username) {
|
||||
if (username === currentUsername || this.loading === username) {
|
||||
this._positionCard($(target));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -152,11 +155,10 @@ export default Mixin.create({
|
|||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return this._show(transformText(matchingEl), matchingEl);
|
||||
}
|
||||
{
|
||||
return false;
|
||||
return this._show(transformText(matchingEl), matchingEl, event);
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
_topicHeaderTrigger(username, $target) {
|
||||
|
@ -302,6 +304,7 @@ export default Mixin.create({
|
|||
visible: false,
|
||||
username: null,
|
||||
loading: null,
|
||||
lastEvent: null,
|
||||
cardTarget: null,
|
||||
post: null,
|
||||
isFixed: false,
|
||||
|
|
Loading…
Reference in New Issue