mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 11:46:18 +08:00
a713c0d366
This commit also add a FIX and a test for toolbar-popup-menu-options which had a behavior slightly specific.
35 lines
977 B
JavaScript
35 lines
977 B
JavaScript
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
|
|
import computed from "ember-addons/ember-computed-decorators";
|
|
|
|
export default DropdownSelectBoxComponent.extend({
|
|
pluginApiIdentifiers: ["toolbar-popup-menu-options"],
|
|
classNames: ["toolbar-popup-menu-options"],
|
|
isHidden: Ember.computed.empty("computedContent"),
|
|
showFullTitle: false,
|
|
|
|
@computed("title")
|
|
collectionHeader(title) {
|
|
return `<h3>${title}</h3>`;
|
|
},
|
|
|
|
autoHighlight() {},
|
|
|
|
computeContent(content) {
|
|
return content
|
|
.map(contentItem => {
|
|
if (contentItem.condition) {
|
|
return {
|
|
icon: contentItem.icon,
|
|
name: I18n.t(contentItem.label),
|
|
id: contentItem.action
|
|
};
|
|
}
|
|
})
|
|
.filter(contentItem => contentItem);
|
|
},
|
|
|
|
// composer is triggering a focus on textarea, we avoid instantly closing
|
|
// popup menu by tweaking the focus out behavior
|
|
onFilterInputFocusout() {}
|
|
});
|