Update workspace switcher menu when tabs removed

This commit is contained in:
Nicholas O'Leary 2013-10-28 20:14:59 +00:00
parent 2e15944b20
commit 9c72b65611
1 changed files with 2 additions and 2 deletions

View File

@ -1049,8 +1049,7 @@ RED.view = function() {
text: "Ok",
click: function() {
var workspace = $(this).dialog('option','workspace');
workspace_tabs.removeTab(workspace.id);
// TODO: make undoable
RED.view.removeWorkspace(workspace);
var historyEvent = RED.nodes.removeWorkspace(workspace.id);
historyEvent.t = 'delete';
historyEvent.dirty = dirty;
@ -1084,6 +1083,7 @@ RED.view = function() {
},
removeWorkspace: function(ws) {
workspace_tabs.removeTab(ws.id);
$('#workspace-menu-list a[href="#'+ws.id+'"]').parent().remove();
},
getWorkspace: function() {
return activeWorkspace;