mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Still parse/export typedInput values even when no options set
This commit is contained in:
parent
a5a79d3ab7
commit
372c213c2c
@ -132,8 +132,8 @@
|
|||||||
return {value:store,label: store, icon:'<i class="red-ui-typedInput-icon fa fa-database" style="color: #'+(store==='memory'?'ddd':'777')+'"></i>'}
|
return {value:store,label: store, icon:'<i class="red-ui-typedInput-icon fa fa-database" style="color: #'+(store==='memory'?'ddd':'777')+'"></i>'}
|
||||||
})
|
})
|
||||||
if (contextOptions.length < 2) {
|
if (contextOptions.length < 2) {
|
||||||
delete allOptions.flow.options;
|
allOptions.flow.options = [];
|
||||||
delete allOptions.global.options
|
allOptions.global.options = [];
|
||||||
} else {
|
} else {
|
||||||
allOptions.flow.options = contextOptions;
|
allOptions.flow.options = contextOptions;
|
||||||
allOptions.global.options = contextOptions;
|
allOptions.global.options = contextOptions;
|
||||||
@ -592,22 +592,31 @@
|
|||||||
var parts = opt.parse(this.input.val());
|
var parts = opt.parse(this.input.val());
|
||||||
if (parts.option) {
|
if (parts.option) {
|
||||||
selectedOption = parts.option;
|
selectedOption = parts.option;
|
||||||
|
if (!this.activeOptions.hasOwnProperty(selectedOption)) {
|
||||||
|
parts.option = Object.keys(this.activeOptions)[0];
|
||||||
|
selectedOption = parts.option
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.input.val(parts.value);
|
this.input.val(parts.value);
|
||||||
if (opt.export) {
|
if (opt.export) {
|
||||||
this.element.val(opt.export(parts.value,parts.option||selectedOption));
|
this.element.val(opt.export(parts.value,parts.option||selectedOption));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof selectedOption === "string") {
|
if (typeof selectedOption === "string") {
|
||||||
this.optionValue = selectedOption;
|
this.optionValue = selectedOption;
|
||||||
if (!this.activeOptions.hasOwnProperty(selectedOption)) {
|
if (!this.activeOptions.hasOwnProperty(selectedOption)) {
|
||||||
selectedOption = Object.keys(this.activeOptions)[0];
|
selectedOption = Object.keys(this.activeOptions)[0];
|
||||||
}
|
}
|
||||||
this._updateOptionSelectLabel(this.activeOptions[selectedOption]);
|
if (!selectedOption) {
|
||||||
} else {
|
this.optionSelectTrigger.hide();
|
||||||
|
} else {
|
||||||
|
this._updateOptionSelectLabel(this.activeOptions[selectedOption]);
|
||||||
|
}
|
||||||
|
} else if (selectedOption) {
|
||||||
this.optionValue = selectedOption.value;
|
this.optionValue = selectedOption.value;
|
||||||
this._updateOptionSelectLabel(selectedOption);
|
this._updateOptionSelectLabel(selectedOption);
|
||||||
|
} else {
|
||||||
|
this.optionSelectTrigger.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user