mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Do not show TypedInput context options if there's only one available
This commit is contained in:
parent
33b4774c49
commit
e6c5cfb703
@ -27,6 +27,9 @@
|
||||
return parts;
|
||||
}
|
||||
var contextExport = function(v,opt) {
|
||||
if (!opt) {
|
||||
return v;
|
||||
}
|
||||
var store = ((typeof opt === "string")?opt:opt.value)
|
||||
if (store !== RED.settings.context.default) {
|
||||
return "#:("+store+")::"+v;
|
||||
@ -128,9 +131,14 @@
|
||||
var contextOptions = contextStores.map(function(store) {
|
||||
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) {
|
||||
delete allOptions.flow.options;
|
||||
delete allOptions.global.options
|
||||
} else {
|
||||
allOptions.flow.options = contextOptions;
|
||||
allOptions.global.options = contextOptions;
|
||||
}
|
||||
}
|
||||
nlsd = true;
|
||||
var that = this;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user