2019-11-08 11:32:20 -05:00
|
|
|
import { empty } from "@ember/object/computed";
|
2017-11-21 05:53:09 -05:00
|
|
|
import ComboBoxComponent from "select-kit/components/combo-box";
|
2017-10-19 15:51:08 -04:00
|
|
|
|
|
|
|
export default ComboBoxComponent.extend({
|
2017-11-21 05:53:09 -05:00
|
|
|
pluginApiIdentifiers: ["topic-footer-mobile-dropdown"],
|
2017-10-19 15:51:08 -04:00
|
|
|
classNames: "topic-footer-mobile-dropdown",
|
|
|
|
filterable: false,
|
|
|
|
autoFilterable: false,
|
2017-11-21 05:53:09 -05:00
|
|
|
allowInitialValueMutation: false,
|
2019-02-07 08:43:33 -05:00
|
|
|
allowAutoSelectFirst: false,
|
|
|
|
nameProperty: "label",
|
2019-11-08 11:32:20 -05:00
|
|
|
isHidden: empty("content"),
|
2017-10-19 15:51:08 -04:00
|
|
|
|
2017-11-21 05:53:09 -05:00
|
|
|
computeHeaderContent() {
|
2019-02-07 08:43:33 -05:00
|
|
|
const content = this._super(...arguments);
|
|
|
|
|
2017-11-21 05:53:09 -05:00
|
|
|
content.name = I18n.t("topic.controls");
|
|
|
|
return content;
|
2017-10-19 15:51:08 -04:00
|
|
|
},
|
|
|
|
|
2019-02-07 08:43:33 -05:00
|
|
|
mutateAttributes() {},
|
2017-10-19 15:51:08 -04:00
|
|
|
|
2019-02-07 08:43:33 -05:00
|
|
|
willComputeContent(content) {
|
|
|
|
content = this._super(content);
|
2017-10-19 15:51:08 -04:00
|
|
|
|
2019-02-07 08:43:33 -05: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 11:03:24 -04:00
|
|
|
});
|
2017-10-19 15:51:08 -04:00
|
|
|
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
});
|