2017-11-21 18:53:09 +08:00
|
|
|
import computed from "ember-addons/ember-computed-decorators";
|
|
|
|
|
2017-11-10 02:57:53 +08:00
|
|
|
export default Ember.Component.extend({
|
2017-11-21 18:53:09 +08:00
|
|
|
attributeBindings: [
|
|
|
|
"tabindex",
|
|
|
|
"content.name:data-name",
|
|
|
|
"content.value:data-value",
|
|
|
|
"guid:data-guid"
|
|
|
|
],
|
|
|
|
classNames: ["selected-name", "choice"],
|
2017-11-10 02:57:53 +08:00
|
|
|
classNameBindings: ["isHighlighted", "isLocked"],
|
2017-11-21 18:53:09 +08:00
|
|
|
layoutName: "select-kit/templates/components/multi-select/selected-name",
|
2017-11-27 00:21:39 +08:00
|
|
|
tagName: "span",
|
2017-11-10 02:57:53 +08:00
|
|
|
tabindex: -1,
|
|
|
|
|
2017-11-21 18:53:09 +08:00
|
|
|
@computed("content")
|
|
|
|
guid(content) { return Ember.guidFor(content); },
|
|
|
|
|
2017-11-10 02:57:53 +08:00
|
|
|
isLocked: Ember.computed("content.locked", function() {
|
|
|
|
return this.getWithDefault("content.locked", false);
|
|
|
|
}),
|
|
|
|
|
|
|
|
click() {
|
|
|
|
if (this.get("isLocked") === true) { return false; }
|
|
|
|
this.toggleProperty("isHighlighted");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|