mirror of
https://github.com/discourse/discourse.git
synced 2026-08-09 04:28:29 -05:00
@@ -22,17 +22,23 @@ export default Component.extend({
|
||||
},
|
||||
|
||||
actions: {
|
||||
changeKey(index, newValue) {
|
||||
changeKey(index, event) {
|
||||
const newValue = event.target.value;
|
||||
|
||||
if (this._checkInvalidInput(newValue)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._replaceValue(index, newValue, "key");
|
||||
},
|
||||
|
||||
changeSecret(index, newValue) {
|
||||
changeSecret(index, event) {
|
||||
const newValue = event.target.value;
|
||||
|
||||
if (this._checkInvalidInput(newValue)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._replaceValue(index, newValue, "secret");
|
||||
},
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ export default Component.extend({
|
||||
},
|
||||
|
||||
@action
|
||||
changeValue(index, newValue) {
|
||||
this.collection.replace(index, 1, [newValue]);
|
||||
changeValue(index, event) {
|
||||
this.collection.replace(index, 1, [event.target.value]);
|
||||
this.collection.arrayContentDidChange(index);
|
||||
this._onChange();
|
||||
},
|
||||
@@ -65,7 +65,7 @@ export default Component.extend({
|
||||
},
|
||||
|
||||
_onChange() {
|
||||
this.attrs.onChange && this.attrs.onChange(this.collection);
|
||||
this.onChange?.(this.collection);
|
||||
},
|
||||
|
||||
@discourseComputed("collection")
|
||||
|
||||
@@ -39,8 +39,8 @@ export default Component.extend({
|
||||
},
|
||||
|
||||
actions: {
|
||||
changeValue(index, newValue) {
|
||||
this._replaceValue(index, newValue);
|
||||
changeValue(index, event) {
|
||||
this._replaceValue(index, event.target.value);
|
||||
},
|
||||
|
||||
addValue(newValue) {
|
||||
|
||||
Reference in New Issue
Block a user