discourse/app/assets/javascripts/select-kit/addon/components/group-members-dropdown.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
804 B
JavaScript
Raw Normal View History

import I18n from "I18n";
2018-04-06 05:11:00 -04:00
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
import { action, computed } from "@ember/object";
2018-04-06 05:11:00 -04:00
export default DropdownSelectBoxComponent.extend({
classNames: ["group-members-dropdown"],
selectKitOptions: {
icon: "bars",
showFullTitle: false
},
content: computed(function() {
2018-04-06 05:11:00 -04:00
const items = [
{
id: "showAddMembersModal",
name: I18n.t("groups.add_members.title"),
icon: "user-plus"
}
];
if (this.currentUser.admin) {
items.push({
id: "showBulkAddModal",
name: I18n.t("admin.groups.bulk_add.title"),
icon: "users"
});
}
return items;
}),
@action
onChange(id) {
this.attrs && this.attrs[id] && this.attrs[id]();
}
2018-04-06 05:11:00 -04:00
});