mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 04:43:43 +08:00
29 lines
773 B
JavaScript
29 lines
773 B
JavaScript
import computed from "ember-addons/ember-computed-decorators";
|
|
|
|
export default Ember.Component.extend({
|
|
attributeBindings: [
|
|
"tabindex",
|
|
"content.name:data-name",
|
|
"content.value:data-value",
|
|
"guid:data-guid"
|
|
],
|
|
classNames: ["selected-name", "choice"],
|
|
classNameBindings: ["isHighlighted", "isLocked"],
|
|
layoutName: "select-kit/templates/components/multi-select/selected-name",
|
|
tagName: "span",
|
|
tabindex: -1,
|
|
|
|
@computed("content")
|
|
guid(content) { return Ember.guidFor(content); },
|
|
|
|
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;
|
|
}
|
|
});
|