Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-26 11:00:28 +01:00
REFACTOR: used new syntax for computed property
Dieser Commit ist enthalten in:
Ursprung
94456fd797
Commit
b2cdc1c29e
1 geänderte Dateien mit 5 neuen und 3 gelöschten Zeilen
|
@ -1,4 +1,5 @@
|
||||||
import { dasherize } from "@ember/string";
|
import { dasherize } from "@ember/string";
|
||||||
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "custom-wizard-field",
|
name: "custom-wizard-field",
|
||||||
|
@ -15,9 +16,10 @@ export default {
|
||||||
FieldComponent.reopen({
|
FieldComponent.reopen({
|
||||||
classNameBindings: ["field.id"],
|
classNameBindings: ["field.id"],
|
||||||
|
|
||||||
textType: function() {
|
@discourseComputed("field.type")
|
||||||
return ['text', 'textarea', 'composer'].includes(this.get('field.type'));
|
textType(fieldType) {
|
||||||
}.property("field.type"),
|
return ['text', 'textarea', 'composer'].includes(fieldType);
|
||||||
|
},
|
||||||
|
|
||||||
cookedDescription: function () {
|
cookedDescription: function () {
|
||||||
return cook(this.get("field.description"));
|
return cook(this.get("field.description"));
|
||||||
|
|
Laden …
In neuem Issue referenzieren