discourse/app/assets/javascripts/select-kit/components/period-chooser.js.es6
Joffrey JAFFEUX d48542796e
FIX: select-kit refactoring
- improve mini-tag-chooser keyboard behavior
- all multil select now respond to select all and left/right arrows
- improve events handling
- many minor tweaks
2018-03-22 11:29:55 +01:00

23 lines
698 B
JavaScript

import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
import computed from "ember-addons/ember-computed-decorators";
export default DropdownSelectBoxComponent.extend({
classNames: ["period-chooser"],
rowComponent: "period-chooser/period-chooser-row",
headerComponent: "period-chooser/period-chooser-header",
content: Ember.computed.alias("site.periods"),
value: Ember.computed.alias("period"),
isHidden: Ember.computed.alias("showPeriods"),
@computed("isExpanded")
caretIcon(isExpanded) {
return isExpanded ? "caret-up" : "caret-down";
},
actions: {
onSelect() {
this.sendAction("action", this.get("computedValue"));
}
}
});