2019-11-09 00:32:20 +08:00
|
|
|
import { empty } from "@ember/object/computed";
|
2017-11-21 18:53:09 +08:00
|
|
|
import ComboBoxComponent from "select-kit/components/combo-box";
|
2017-10-20 03:51:08 +08:00
|
|
|
|
|
|
|
export default ComboBoxComponent.extend({
|
2017-11-21 18:53:09 +08:00
|
|
|
pluginApiIdentifiers: ["topic-footer-mobile-dropdown"],
|
2017-10-20 03:51:08 +08:00
|
|
|
classNames: "topic-footer-mobile-dropdown",
|
|
|
|
filterable: false,
|
|
|
|
autoFilterable: false,
|
2017-11-21 18:53:09 +08:00
|
|
|
allowInitialValueMutation: false,
|
2019-02-07 21:43:33 +08:00
|
|
|
allowAutoSelectFirst: false,
|
|
|
|
nameProperty: "label",
|
2019-11-09 00:32:20 +08:00
|
|
|
isHidden: empty("content"),
|
2017-10-20 03:51:08 +08:00
|
|
|
|
2017-11-21 18:53:09 +08:00
|
|
|
computeHeaderContent() {
|
2019-02-07 21:43:33 +08:00
|
|
|
const content = this._super(...arguments);
|
|
|
|
|
2017-11-21 18:53:09 +08:00
|
|
|
content.name = I18n.t("topic.controls");
|
|
|
|
return content;
|
2017-10-20 03:51:08 +08:00
|
|
|
},
|
|
|
|
|
2019-02-07 21:43:33 +08:00
|
|
|
mutateAttributes() {},
|
2017-10-20 03:51:08 +08:00
|
|
|
|
2019-02-07 21:43:33 +08:00
|
|
|
willComputeContent(content) {
|
|
|
|
content = this._super(content);
|
2017-10-20 03:51:08 +08:00
|
|
|
|
2019-02-07 21:43:33 +08:00
|
|
|
// TODO: this is for backward compat reasons, should be removed
|
|
|
|
// when plugins have been updated for long enough
|
|
|
|
content.forEach(c => {
|
|
|
|
if (c.name) {
|
|
|
|
c.label = c.name;
|
|
|
|
}
|
2018-06-15 23:03:24 +08:00
|
|
|
});
|
2017-10-20 03:51:08 +08:00
|
|
|
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
});
|