mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Ensure tabs get their definition object properly attached
This commit is contained in:
		| @@ -41,6 +41,15 @@ RED.nodes = (function() { | ||||
|         var typeToId = {}; | ||||
|         var nodeDefinitions = {}; | ||||
|  | ||||
|         nodeDefinitions['tab'] = { | ||||
|             defaults: { | ||||
|                 label: {value:""}, | ||||
|                 disabled: {value: false}, | ||||
|                 info: {value: ""} | ||||
|             } | ||||
|         }; | ||||
|  | ||||
|  | ||||
|         var exports = { | ||||
|             setModulePendingUpdated: function(module,version) { | ||||
|                 moduleList[module].pending_version = version; | ||||
| @@ -274,14 +283,7 @@ RED.nodes = (function() { | ||||
|  | ||||
|     function addWorkspace(ws) { | ||||
|         workspaces[ws.id] = ws; | ||||
|         ws._def = { | ||||
|             defaults: { | ||||
|                 label: {value:""}, | ||||
|                 disabled: {value: false}, | ||||
|                 info: {value: ""} | ||||
|             } | ||||
|         }; | ||||
|  | ||||
|         ws._def = RED.nodes.getType('tab'); | ||||
|         workspacesOrder.push(ws.id); | ||||
|     } | ||||
|     function getWorkspace(id) { | ||||
| @@ -817,7 +819,7 @@ RED.nodes = (function() { | ||||
|  | ||||
|         // Add a tab if there isn't one there already | ||||
|         if (defaultWorkspace == null) { | ||||
|             defaultWorkspace = { type:"tab", id:getID(), label:RED._('workspace.defaultName',{number:1})}; | ||||
|             defaultWorkspace = { type:"tab", id:getID(), disabled: false, info:"",  label:RED._('workspace.defaultName',{number:1})}; | ||||
|             addWorkspace(defaultWorkspace); | ||||
|             RED.workspaces.add(defaultWorkspace); | ||||
|             new_workspaces.push(defaultWorkspace); | ||||
|   | ||||
| @@ -30,7 +30,7 @@ RED.workspaces = (function() { | ||||
|                 workspaceIndex += 1; | ||||
|             } while ($("#workspace-tabs a[title='"+RED._('workspace.defaultName',{number:workspaceIndex})+"']").size() !== 0); | ||||
|  | ||||
|             ws = {type:"tab",id:tabId,label:RED._('workspace.defaultName',{number:workspaceIndex})}; | ||||
|             ws = {type:"tab",id:tabId,disabled: false,info:"",label:RED._('workspace.defaultName',{number:workspaceIndex})}; | ||||
|             RED.nodes.addWorkspace(ws); | ||||
|             workspace_tabs.addTab(ws); | ||||
|             workspace_tabs.activateTab(tabId); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user