This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/dropdown-select-box.js.es6
Joffrey JAFFEUX e924920bec uses select-box for pinned-button
This commit also moves more logic in dropdown-select-box instead of
duplicating it for notifications-options and pinned-options
2017-09-11 19:14:22 +02:00

34 lines
956 B
JavaScript

import computed from "ember-addons/ember-computed-decorators";
import SelectBoxComponent from "discourse/components/select-box";
export default SelectBoxComponent.extend({
classNames: ["dropdown-select-box"],
wrapper: false,
verticalOffset: 3,
collectionHeight: "auto",
fullWidthOnMobile: true,
selectBoxHeaderComponent: "dropdown-select-box/dropdown-header",
@computed
templateForRow: function() {
return (rowComponent) => {
let template = "";
const content = rowComponent.get("content");
const icon = rowComponent.icon();
if (icon) {
template += `<div class="icons">${icon}</div>`;
}
template += `
<div class="texts">
<span class="title">${Handlebars.escapeExpression(Ember.get(content, this.get("textKey")))}</span>
<span class="desc">${Handlebars.escapeExpression(content.description)}</span>
</div>
`;
return template;
};
}
});