Commit 1a2e0df8 authored by Marcel Rieger's avatar Marcel Rieger
Browse files

Fix double selecting of workspaces with auto connect.

parent 39b0e2ef
......@@ -72,11 +72,11 @@ var WorkspaceManager = VispaModule.extend({
});
}
});
var connect = function() {
var connect = function(selectedId) {
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)
$.each(self.workspaceData.data, function(_, data) {
if (!~ids.indexOf(data.id) && data.auto_connect && data.id != selectedId)
ids.push(data.id);
});
$.each(ids, function(i, id) {
......@@ -90,7 +90,7 @@ var WorkspaceManager = VispaModule.extend({
var workspace = self.getWorkspace(selectedId);
if (workspace) {
self.workspaceData.connected.splice(idx, 1);
workspace.once("selected", connect.bind(null));
workspace.once("selected", connect.bind(null, selectedId));
workspace.select();
}
} else
......
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