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/app/components/flag-selection.js
Roman Rizzi 8fcad73b36
FEATURE: Admins can flag posts so they can review them later. (#12311)
Staff can send a post to the review queue by clicking the "Flag Post" button next to "Take Action...". Clicking it flags the post using the "Notify moderators" score type and hides it. A custom message will be sent to the user.
2021-03-11 08:21:24 -03:00

26 lines
629 B
JavaScript

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