mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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,
|
isFixed: false,
|
||||||
isDocked: false,
|
isDocked: false,
|
||||||
|
|
||||||
_show(username, target) {
|
_show(username, target, event) {
|
||||||
// No user card for anon
|
// No user card for anon
|
||||||
if (this.siteSettings.hide_user_profiles_from_public && !this.currentUser) {
|
if (this.siteSettings.hide_user_profiles_from_public && !this.currentUser) {
|
||||||
return false;
|
return false;
|
||||||
@ -54,8 +54,11 @@ export default Mixin.create({
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.set("lastEvent", event);
|
||||||
|
|
||||||
const currentUsername = this.username;
|
const currentUsername = this.username;
|
||||||
if (username === currentUsername && this.loading === username) {
|
if (username === currentUsername || this.loading === username) {
|
||||||
|
this._positionCard($(target));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,11 +155,10 @@ export default Mixin.create({
|
|||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
return this._show(transformText(matchingEl), matchingEl);
|
return this._show(transformText(matchingEl), matchingEl, event);
|
||||||
}
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
_topicHeaderTrigger(username, $target) {
|
_topicHeaderTrigger(username, $target) {
|
||||||
@ -302,6 +304,7 @@ export default Mixin.create({
|
|||||||
visible: false,
|
visible: false,
|
||||||
username: null,
|
username: null,
|
||||||
loading: null,
|
loading: null,
|
||||||
|
lastEvent: null,
|
||||||
cardTarget: null,
|
cardTarget: null,
|
||||||
post: null,
|
post: null,
|
||||||
isFixed: false,
|
isFixed: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user