Files
discourse/app/assets/javascripts/discourse/components/select-box/select-box-header.js.es6
Guo Xiang Tan 0a53c589c4 Fix linting.
2017-08-30 15:36:45 +08:00

24 lines
435 B
JavaScript

export default Ember.Component.extend({
classNames: "select-box-header",
classNameBindings: ["focused:is-focused"],
didReceiveAttrs() {
this._super();
this._setCaretIcon();
},
click() {
this.sendAction("onToggle");
},
_setCaretIcon() {
if(this.get("expanded")) {
this.set("caretIcon", this.get("caretUpIcon"));
} else {
this.set("caretIcon", this.get("caretDownIcon"));
}
}
});