1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add add-tab button to tab bar

This commit is contained in:
Nicholas O'Leary 2013-10-28 22:31:36 +00:00
parent a8f5d6b9ee
commit 12d8d45f83
3 changed files with 28 additions and 2 deletions

View File

@ -122,6 +122,7 @@
<div id="workspace">
<ul id="workspace-tabs"></ul>
<div id="workspace-add-tab"><a id="btn-workspace-add-tab" href="#"><i class="icon-plus"></i></a></div>
<div id="chart"></div>
</div>

View File

@ -89,7 +89,8 @@ RED.view = function() {
});
var workspaceIndex = 0;
$('#btn-workspace-add').on("click",function() {
function addWorkspace() {
var tabId = RED.nodes.id();
do {
workspaceIndex += 1;
@ -102,7 +103,9 @@ RED.view = function() {
RED.history.push({t:'add',workspaces:[ws],dirty:dirty});
RED.view.dirty(true);
});
}
$('#btn-workspace-add-tab').on("click",addWorkspace);
$('#btn-workspace-add').on("click",addWorkspace);
$('#btn-workspace-edit').on("click",function() {
showRenameWorkspaceDialog(activeWorkspace);
});

View File

@ -569,6 +569,28 @@ div.node-info {
border-radius:5px;
overflow: hidden;
}
#workspace-tabs {
margin-right: 28px;
}
#workspace-add-tab {
position: absolute;
top: 0;
right: 0;
height: 29px;
width: 28px;
border-bottom: 1px solid #999;
}
#btn-workspace-add-tab {
display: inline-block;
width: 100%;
background: #e3e3e3;
height: 100%;
line-height: 28px;
text-align: center;
}
#btn-workspace-add-tab:hover {
background: #efefef;
}
ul.red-ui-tabs {
list-style-type: none;