mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Hide the subflow check logic inside getDefaultNodeIcon function
This commit is contained in:
		| @@ -787,12 +787,7 @@ RED.editor = (function() { | ||||
|             var clear = $('<button class="editor-button editor-button-small"><i class="fa fa-times"></i></button>').appendTo(iconForm); | ||||
|             clear.click(function(evt) { | ||||
|                 evt.preventDefault(); | ||||
|                 var iconPath; | ||||
|                 if (node.type === "subflow") { | ||||
|                     iconPath = { module:"node-red", file:"subflow.png" }; | ||||
|                 } else { | ||||
|                     iconPath = RED.utils.getDefaultNodeIcon(node._def, node); | ||||
|                 } | ||||
|                 var iconPath = RED.utils.getDefaultNodeIcon(node._def, node); | ||||
|                 selectIconModule.val(iconPath.module); | ||||
|                 moduleChange(selectIconModule, selectIconFile, iconModuleHidden, iconFileHidden, iconSets, true); | ||||
|                 selectIconFile.removeClass("input-error"); | ||||
|   | ||||
| @@ -708,7 +708,9 @@ RED.utils = (function() { | ||||
|  | ||||
|     function getDefaultNodeIcon(def,node) { | ||||
|         var icon_url; | ||||
|         if (typeof def.icon === "function") { | ||||
|         if (node && node.type === "subflow") { | ||||
|             icon_url = "node-red/subflow.png"; | ||||
|         } else if (typeof def.icon === "function") { | ||||
|             try { | ||||
|                 icon_url = def.icon.call(node); | ||||
|             } catch(err) { | ||||
| @@ -753,8 +755,6 @@ RED.utils = (function() { | ||||
|             if (isIconExists(iconPath)) { | ||||
|                 return "icons/" + node.icon; | ||||
|             } | ||||
|         } else if (node && node.type === 'subflow') { | ||||
|             return "icons/node-red/subflow.png" | ||||
|         } | ||||
|  | ||||
|         var iconPath = getDefaultNodeIcon(def, node); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user