mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	changed to color change reflect immediately on OK
This commit is contained in:
		| @@ -2219,6 +2219,8 @@ RED.editor = (function() { | ||||
|                             editing_node.color = newColor; | ||||
|                             changes.color = newColor; | ||||
|                             changed = true; | ||||
|                             RED.utils.clearNodeColorCache(); | ||||
|                             RED.palette.changeSubflowColor(editing_node, newColor); | ||||
|                         } | ||||
|  | ||||
|                         var old_env = editing_node.env; | ||||
| @@ -2228,7 +2230,6 @@ RED.editor = (function() { | ||||
|                             changes.env = editing_node.env; | ||||
|                             changed = true; | ||||
|                         } | ||||
|  | ||||
|                         RED.palette.refresh(); | ||||
|  | ||||
|                         if (changed) { | ||||
| @@ -2242,6 +2243,7 @@ RED.editor = (function() { | ||||
|                                         id:n.id, | ||||
|                                         changed:n.changed | ||||
|                                     }) | ||||
|                                     n._def.color = editing_node.color; | ||||
|                                     n.changed = true; | ||||
|                                     n.dirty = true; | ||||
|                                     updateNodeProperties(n); | ||||
|   | ||||
| @@ -593,6 +593,11 @@ RED.palette = (function() { | ||||
|         setTimeout(function() { $(window).trigger("resize"); } ,200); | ||||
|     } | ||||
|  | ||||
|     function changeSubflowColor(sf, color) { | ||||
|         var paletteNode = getPaletteNode('subflow:'+sf.id); | ||||
|         paletteNode.css("backgroundColor", color); | ||||
|     } | ||||
|  | ||||
|  | ||||
|     function getCategories() { | ||||
|         var categories = []; | ||||
| @@ -608,6 +613,7 @@ RED.palette = (function() { | ||||
|         hide:hideNodeType, | ||||
|         show:showNodeType, | ||||
|         refresh:refreshNodeTypes, | ||||
|         getCategories: getCategories | ||||
|         getCategories: getCategories, | ||||
|         changeSubflowColor: changeSubflowColor | ||||
|     }; | ||||
| })(); | ||||
|   | ||||
| @@ -912,6 +912,10 @@ RED.utils = (function() { | ||||
|     } | ||||
|  | ||||
|     var nodeColorCache = {}; | ||||
|     function clearNodeColorCache() { | ||||
|         nodeColorCache = {}; | ||||
|     } | ||||
|  | ||||
|     function getNodeColor(type, def) { | ||||
|         var result = def.color; | ||||
|         var paletteTheme = RED.settings.theme('palette.theme') || []; | ||||
| @@ -1044,6 +1048,7 @@ RED.utils = (function() { | ||||
|         getNodeIcon: getNodeIcon, | ||||
|         getNodeLabel: getNodeLabel, | ||||
|         getNodeColor: getNodeColor, | ||||
|         clearNodeColorCache: clearNodeColorCache, | ||||
|         addSpinnerOverlay: addSpinnerOverlay, | ||||
|         decodeObject: decodeObject, | ||||
|         parseContextKey: parseContextKey, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user