mirror of
https://github.com/discourse/discourse.git
synced 2025-02-11 06:58:46 +08:00
17 lines
601 B
JavaScript
17 lines
601 B
JavaScript
export default Ember.ObjectController.extend({
|
|
userActionType: null,
|
|
needs: ["application"],
|
|
|
|
_showFooter: function() {
|
|
var showFooter;
|
|
if (this.get("userActionType")) {
|
|
const stat = _.find(this.get("model.stats"), { action_type: this.get("userActionType") });
|
|
showFooter = stat && stat.count <= this.get("model.stream.itemsLoaded");
|
|
} else {
|
|
showFooter = this.get("model.statsCountNonPM") <= this.get("model.stream.itemsLoaded");
|
|
}
|
|
this.set("controllers.application.showFooter", showFooter);
|
|
}.observes("userActionType", "model.stream.itemsLoaded")
|
|
|
|
});
|