* DEV: Add the actual "tag_groups/new" route
Allows refreshing the "new" page without an error.
* DEV: Prevent attempts to create group tags if tagging is disabled
* DEV: Refactor the tag-groups controller
Gets rid of `selectedItem`, `selected`, and `selectTagGroup` action.
* DEV: Rename tag-groups-show to tag-groups-edit
* DEV: Refactor tag-groups form
* Extracted the tag-groups-form that's used by tag-groups-new and tag-groups-edit
* The model is now a buffered property
* Serialization relies more heavily on RestAdapter now
* Data is sent as JSON
* Payload is now namespaced ("tag_group")
* Update app/assets/javascripts/discourse/controllers/tag-groups-new.js.es6
Co-Authored-By: Joffrey JAFFEUX <j.jaffeux@gmail.com>
* Update app/assets/javascripts/discourse/components/tag-groups-form.js.es6
Co-Authored-By: Joffrey JAFFEUX <j.jaffeux@gmail.com>
* Update app/assets/javascripts/discourse/controllers/tag-groups-edit.js.es6
Co-Authored-By: Joffrey JAFFEUX <j.jaffeux@gmail.com>
33 lines
650 B
JavaScript
33 lines
650 B
JavaScript
import Component from "@ember/component";
|
|
import computed from "ember-addons/ember-computed-decorators";
|
|
|
|
export default Component.extend({
|
|
tagName: "input",
|
|
type: "radio",
|
|
attributeBindings: [
|
|
"name",
|
|
"type",
|
|
"value",
|
|
"checked:checked",
|
|
"disabled:disabled"
|
|
],
|
|
|
|
click() {
|
|
const value = $(this.element).val();
|
|
|
|
if (this.onChange) {
|
|
this.onChange(value);
|
|
} else {
|
|
if (this.selection === value) {
|
|
this.set("selection", undefined);
|
|
}
|
|
this.set("selection", value);
|
|
}
|
|
},
|
|
|
|
@computed("value", "selection")
|
|
checked(value, selection) {
|
|
return value === selection;
|
|
}
|
|
});
|