mirror of
https://ghfast.top/https://github.com/discourse/discourse-follow.git
synced 2026-07-15 11:36:38 +08:00
25 lines
600 B
JavaScript
25 lines
600 B
JavaScript
import Component from "@ember/component";
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
|
|
export default Component.extend({
|
|
classNames: "follow-statistic",
|
|
|
|
init() {
|
|
this._super();
|
|
this.set("tagName", this.get("isCard") ? "h3" : "div");
|
|
},
|
|
|
|
didInsertElement() {
|
|
Ember.run.scheduleOnce("afterRender", () => {
|
|
let parent = this.get("isCard")
|
|
? ".card-content .metadata"
|
|
: ".user-main .secondary dl";
|
|
this.$().prependTo(parent);
|
|
});
|
|
},
|
|
|
|
@discourseComputed("context")
|
|
isCard(context) {
|
|
return context === "card";
|
|
},
|
|
});
|