mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 10:50:26 -06:00
DEV: add app event for user-card:after-show (#15227)
Adds user-card:after-show event for when a usercard is fully loaded and shown.
This commit is contained in:
parent
3b0d46c659
commit
51abcd7524
@ -174,7 +174,7 @@ export default Component.extend(CardContentsBase, CanCheckEmails, CleansUp, {
|
||||
include_post_count_for: this.get("topic.id"),
|
||||
};
|
||||
|
||||
User.findByUsername(username, args)
|
||||
return User.findByUsername(username, args)
|
||||
.then((user) => {
|
||||
if (user.topic_post_count) {
|
||||
this.set(
|
||||
@ -183,6 +183,7 @@ export default Component.extend(CardContentsBase, CanCheckEmails, CleansUp, {
|
||||
);
|
||||
}
|
||||
this.setProperties({ user });
|
||||
return user;
|
||||
})
|
||||
.catch(() => this._close())
|
||||
.finally(() => this.set("loading", null));
|
||||
|
@ -86,7 +86,9 @@ export default Mixin.create({
|
||||
});
|
||||
|
||||
this.appEvents.trigger("user-card:show", { username });
|
||||
this._showCallback(username, $(target));
|
||||
this._showCallback(username, $(target)).then((user) => {
|
||||
this.appEvents.trigger("user-card:after-show", { user });
|
||||
});
|
||||
|
||||
// We bind scrolling on mobile after cards are shown to hide them if user scrolls
|
||||
if (this.site.mobileView) {
|
||||
|
Loading…
Reference in New Issue
Block a user