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/flag-selection.js.es6
Joffrey JAFFEUX b3eb67976d
DEV: Upgrades to Ember 3.10 (#7871)
Co-Authored-By: majakomel <maja.komel@gmail.com>
2019-07-16 12:45:15 +02:00

21 lines
509 B
JavaScript

import { observes } from "ember-addons/ember-computed-decorators";
// Mostly hacks because `flag.hbs` didn't use `radio-button`
export default Ember.Component.extend({
_selectRadio() {
this.element.querySelector("input[type='radio']").checked = false;
const nameKey = this.nameKey;
if (!nameKey) {
return;
}
this.element.querySelector("#radio_" + nameKey).checked = "true";
},
@observes("nameKey")
selectedChanged() {
Ember.run.next(this, this._selectRadio);
}
});