discourse/app/assets/javascripts/select-kit/components/toolbar-popup-menu-options....

35 lines
990 B
Plaintext
Raw Normal View History

import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
import discourseComputed from "discourse-common/utils/decorators";
export default DropdownSelectBoxComponent.extend({
pluginApiIdentifiers: ["toolbar-popup-menu-options"],
classNames: ["toolbar-popup-menu-options"],
isHidden: Ember.computed.empty("computedContent"),
showFullTitle: false,
@discourseComputed("title")
collectionHeader(title) {
2017-12-26 03:51:45 -05:00
return `<h3>${title}</h3>`;
},
autoHighlight() {},
computeContent(content) {
2018-06-15 11:03:24 -04:00
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() {}
});