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/track-selected.js
2020-03-12 13:29:55 -04:00

20 lines
423 B
JavaScript

import Component from "@ember/component";
import { observes } from "discourse-common/utils/decorators";
export default Component.extend({
tagName: "span",
@observes("selected")
selectionChanged: function() {
const selected = this.selected;
const list = this.selectedList;
const id = this.selectedId;
if (selected) {
list.addObject(id);
} else {
list.removeObject(id);
}
}
});