* DEV: Remove buffered rendering from group-index-toggle
This is the first step in a refactor to remove all uses of our Buffered
Renderer:
01e2d5a670/app/assets/javascripts/discourse-common/lib/buffered-render.js.es6 (L3)
This commit affects the header sorting on the group member and the group
requests pages. It is a refactor only with no change in functionality.
31 lines
779 B
JavaScript
31 lines
779 B
JavaScript
import Component from "@ember/component";
|
|
import { iconHTML } from "discourse-common/lib/icon-library";
|
|
|
|
export default Component.extend({
|
|
tagName: "th",
|
|
classNames: ["sortable"],
|
|
chevronIcon: null,
|
|
toggleProperties() {
|
|
if (this.order === this.field) {
|
|
this.set("desc", this.desc ? null : true);
|
|
} else {
|
|
this.setProperties({ order: this.field, desc: null });
|
|
}
|
|
},
|
|
toggleChevron() {
|
|
if (this.order === this.field) {
|
|
let chevron = iconHTML(this.desc ? "chevron-down" : "chevron-up");
|
|
this.set("chevronIcon", `${chevron}`.htmlSafe());
|
|
} else {
|
|
this.set("chevronIcon", null);
|
|
}
|
|
},
|
|
click() {
|
|
this.toggleProperties();
|
|
},
|
|
didReceiveAttrs() {
|
|
this._super(...arguments);
|
|
this.toggleChevron();
|
|
}
|
|
});
|