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