mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Rename flow menu ids back to workspace
This commit is contained in:
parent
5f9780d71c
commit
ca91a5dd95
@ -203,7 +203,7 @@ RED.history = (function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (ev.node.type === 'subflow') {
|
if (ev.node.type === 'subflow') {
|
||||||
$("#menu-item-flow-menu-"+ev.node.id.replace(".","-")).text(ev.node.name);
|
$("#menu-item-workspace-menu-"+ev.node.id.replace(".","-")).text(ev.node.name);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
RED.editor.updateNodeProperties(ev.node);
|
RED.editor.updateNodeProperties(ev.node);
|
||||||
|
@ -180,10 +180,10 @@ var RED = (function() {
|
|||||||
{id:"menu-item-subflow-convert",label:RED._("menu.label.selectionToSubflow"),disabled:true,onselect:RED.subflow.convertToSubflow},
|
{id:"menu-item-subflow-convert",label:RED._("menu.label.selectionToSubflow"),disabled:true,onselect:RED.subflow.convertToSubflow},
|
||||||
]},
|
]},
|
||||||
null,
|
null,
|
||||||
{id:"menu-item-flow",label:RED._("menu.label.flows"),options:[
|
{id:"menu-item-workspace",label:RED._("menu.label.flows"),options:[
|
||||||
{id:"menu-item-flow-add",label:RED._("menu.label.add"),onselect:RED.workspaces.add},
|
{id:"menu-item-workspace-add",label:RED._("menu.label.add"),onselect:RED.workspaces.add},
|
||||||
{id:"menu-item-flow-edit",label:RED._("menu.label.rename"),onselect:RED.workspaces.edit},
|
{id:"menu-item-workspace-edit",label:RED._("menu.label.rename"),onselect:RED.workspaces.edit},
|
||||||
{id:"menu-item-flow-delete",label:RED._("menu.label.delete"),onselect:RED.workspaces.remove},
|
{id:"menu-item-workspace-delete",label:RED._("menu.label.delete"),onselect:RED.workspaces.remove},
|
||||||
null
|
null
|
||||||
]},
|
]},
|
||||||
null,
|
null,
|
||||||
|
@ -1063,7 +1063,7 @@ RED.editor = (function() {
|
|||||||
changes['name'] = editing_node.name;
|
changes['name'] = editing_node.name;
|
||||||
editing_node.name = newName;
|
editing_node.name = newName;
|
||||||
changed = true;
|
changed = true;
|
||||||
$("#menu-item-flow-menu-"+editing_node.id.replace(".","-")).text(newName);
|
$("#menu-item-workspace-menu-"+editing_node.id.replace(".","-")).text(newName);
|
||||||
}
|
}
|
||||||
|
|
||||||
RED.palette.refresh();
|
RED.palette.refresh();
|
||||||
|
@ -256,8 +256,8 @@ RED.view = (function() {
|
|||||||
|
|
||||||
activeSubflow = RED.nodes.subflow(event.workspace);
|
activeSubflow = RED.nodes.subflow(event.workspace);
|
||||||
|
|
||||||
RED.menu.setDisabled("menu-item-flow-edit", activeSubflow);
|
RED.menu.setDisabled("menu-item-workspace-edit", activeSubflow);
|
||||||
RED.menu.setDisabled("menu-item-flow-delete",RED.workspaces.count() == 1 || activeSubflow);
|
RED.menu.setDisabled("menu-item-workspace-delete",RED.workspaces.count() == 1 || activeSubflow);
|
||||||
|
|
||||||
if (workspaceScrollPositions[event.workspace]) {
|
if (workspaceScrollPositions[event.workspace]) {
|
||||||
chart.scrollLeft(workspaceScrollPositions[event.workspace].left);
|
chart.scrollLeft(workspaceScrollPositions[event.workspace].left);
|
||||||
|
@ -100,18 +100,18 @@ RED.workspaces = (function() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onadd: function(tab) {
|
onadd: function(tab) {
|
||||||
RED.menu.addItem("menu-item-flow",{
|
RED.menu.addItem("menu-item-workspace",{
|
||||||
id:"menu-item-flow-menu-"+tab.id.replace(".","-"),
|
id:"menu-item-workspace-menu-"+tab.id.replace(".","-"),
|
||||||
label:tab.label,
|
label:tab.label,
|
||||||
onselect:function() {
|
onselect:function() {
|
||||||
workspace_tabs.activateTab(tab.id);
|
workspace_tabs.activateTab(tab.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
RED.menu.setDisabled("menu-item-flow-delete",workspace_tabs.count() == 1);
|
RED.menu.setDisabled("menu-item-workspace-delete",workspace_tabs.count() == 1);
|
||||||
},
|
},
|
||||||
onremove: function(tab) {
|
onremove: function(tab) {
|
||||||
RED.menu.setDisabled("menu-item-flow-delete",workspace_tabs.count() == 1);
|
RED.menu.setDisabled("menu-item-workspace-delete",workspace_tabs.count() == 1);
|
||||||
RED.menu.removeItem("menu-item-flow-menu-"+tab.id.replace(".","-"));
|
RED.menu.removeItem("menu-item-workspace-menu-"+tab.id.replace(".","-"));
|
||||||
},
|
},
|
||||||
minimumActiveTabWidth: 150
|
minimumActiveTabWidth: 150
|
||||||
});
|
});
|
||||||
@ -141,7 +141,7 @@ RED.workspaces = (function() {
|
|||||||
if (workspace.label != label) {
|
if (workspace.label != label) {
|
||||||
workspace_tabs.renameTab(workspace.id,label);
|
workspace_tabs.renameTab(workspace.id,label);
|
||||||
RED.nodes.dirty(true);
|
RED.nodes.dirty(true);
|
||||||
$("#menu-item-flow-menu-"+workspace.id.replace(".","-")).text(label);
|
$("#menu-item-workspace-menu-"+workspace.id.replace(".","-")).text(label);
|
||||||
// TODO: update entry in menu
|
// TODO: update entry in menu
|
||||||
}
|
}
|
||||||
$( this ).dialog( "close" );
|
$( this ).dialog( "close" );
|
||||||
@ -209,7 +209,7 @@ RED.workspaces = (function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
RED.menu.setAction('menu-item-flow-delete',function() {
|
RED.menu.setAction('menu-item-workspace-delete',function() {
|
||||||
deleteWorkspace(RED.nodes.workspace(activeWorkspace));
|
deleteWorkspace(RED.nodes.workspace(activeWorkspace));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user