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