Commit 39b0e2ef authored by Marcel Rieger's avatar Marcel Rieger
Browse files

Fix workspace auto connect bug.

parent d195737a
......@@ -72,7 +72,13 @@ var WorkspaceManager = VispaModule.extend({
});
}
});
var connect = function(ids) {
var connect = function() {
var ids = self.workspaceData.connected;
// extend ids by workspace ids with auto_connect
$.each(self.workspaceData.data, function(id, data) {
if (!~ids.indexOf(data.id) && data.auto_connect)
ids.push(data.id);
});
$.each(ids, function(i, id) {
self.connectWorkspace(id, false);
});
......@@ -84,11 +90,11 @@ var WorkspaceManager = VispaModule.extend({
var workspace = self.getWorkspace(selectedId);
if (workspace) {
self.workspaceData.connected.splice(idx, 1);
workspace.once("selected", connect.bind(null, self.workspaceData.connected));
workspace.once("selected", connect.bind(null));
workspace.select();
}
} else
connect(self.workspaceData.connected);
connect();
});
if (!Object.keys(self.workspaceData.data).length)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment