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/select-box/select-box-header.js.es6

25 lines
469 B
JavaScript

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