mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Open subflow tab next to active tab rather than at the end
This commit is contained in:
parent
c8653f19bf
commit
866f305686
@ -785,6 +785,9 @@ RED.tabs = (function() {
|
|||||||
count: function() {
|
count: function() {
|
||||||
return ul.find("li.red-ui-tab").length;
|
return ul.find("li.red-ui-tab").length;
|
||||||
},
|
},
|
||||||
|
activeIndex: function() {
|
||||||
|
return ul.find("li.active").index()
|
||||||
|
},
|
||||||
contains: function(id) {
|
contains: function(id) {
|
||||||
return ul.find("a[href='#"+id+"']").length > 0;
|
return ul.find("a[href='#"+id+"']").length > 0;
|
||||||
},
|
},
|
||||||
|
@ -493,7 +493,11 @@ RED.workspaces = (function() {
|
|||||||
if (!workspace_tabs.contains(id)) {
|
if (!workspace_tabs.contains(id)) {
|
||||||
var sf = RED.nodes.subflow(id);
|
var sf = RED.nodes.subflow(id);
|
||||||
if (sf) {
|
if (sf) {
|
||||||
addWorkspace({type:"subflow",id:id,icon:"red/images/subflow_tab.svg",label:sf.name, closeable: true});
|
addWorkspace(
|
||||||
|
{type:"subflow",id:id,icon:"red/images/subflow_tab.svg",label:sf.name, closeable: true},
|
||||||
|
null,
|
||||||
|
workspace_tabs.activeIndex()+1
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user