mirror of
https://github.com/nasa/openmct.git
synced 2025-05-31 22:50:49 +00:00
[Summary Widgets] Adding a new condition to a rule deletes the input value from previous ones #2411 (#2481)
* [Summary Widgets] Adding a new condition to a rule deletes the input value from previous ones #2411 * Summary Widget Rule conditions not persisting numeric values #2491
This commit is contained in:
parent
43515ca84e
commit
5dbd77d10c
@ -180,7 +180,7 @@ define([
|
|||||||
|
|
||||||
inputArea.html('');
|
inputArea.html('');
|
||||||
this.valueInputs = [];
|
this.valueInputs = [];
|
||||||
this.config.values = [];
|
this.config.values = this.config.values || [];
|
||||||
|
|
||||||
if (evaluator.getInputCount(operation)) {
|
if (evaluator.getInputCount(operation)) {
|
||||||
inputCount = evaluator.getInputCount(operation);
|
inputCount = evaluator.getInputCount(operation);
|
||||||
@ -191,8 +191,10 @@ define([
|
|||||||
newInput = $('<select>' + this.generateSelectOptions() + '</select>');
|
newInput = $('<select>' + this.generateSelectOptions() + '</select>');
|
||||||
emitChange = true;
|
emitChange = true;
|
||||||
} else {
|
} else {
|
||||||
this.config.values[index] = inputType === 'number' ? 0 : '';
|
const defaultValue = inputType === 'number' ? 0 : '';
|
||||||
newInput = $('<input type = "' + inputType + '" value = "' + this.config.values[index] + '"> </input>');
|
const value = this.config.values[index] || defaultValue;
|
||||||
|
this.config.values[index] = value;
|
||||||
|
newInput = $('<input type = "' + inputType + '" value = "' + value + '"></input>');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.valueInputs.push(newInput.get(0));
|
this.valueInputs.push(newInput.get(0));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user