Skip to content

Commit ff36420

Browse files
committed
[skip ci] Pop up Service catlog always on center
1 parent cb0993e commit ff36420

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,6 @@ qx.Class.define("osparc.desktop.WorkbenchView", {
356356
this.__workbenchUI.openServiceCatalog({
357357
x: 50,
358358
y: 50
359-
}, {
360-
x: 50,
361-
y: 50
362359
});
363360
});
364361
homeAndNodesTree.add(addNewNodeBtn);

services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,11 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
290290
},
291291

292292
__openServiceCatalog: function(e) {
293-
const winPos = this.__pointerEventToScreenPos(e);
294293
const nodePos = this.__pointerEventToWorkbenchPos(e);
295-
this.openServiceCatalog(winPos, nodePos);
294+
this.openServiceCatalog(nodePos);
296295
},
297296

298-
openServiceCatalog: function(winPos, nodePos) {
297+
openServiceCatalog: function(nodePos) {
299298
if (this.getStudy().isReadOnly()) {
300299
return null;
301300
}
@@ -766,8 +765,7 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
766765
let dragNodeId = data.nodeId;
767766

768767
if (this.__tempEdgeNodeId === dragNodeId) {
769-
const winPos = this.__unscaleCoordinates(this.__pointerPos.x, this.__pointerPos.y);
770-
const srvCat = this.openServiceCatalog(winPos, this.__pointerPos);
768+
const srvCat = this.openServiceCatalog(this.__pointerPos);
771769
if (srvCat) {
772770
this.__tempEdgeIsInput === true ? srvCat.setContext(null, dragNodeId) : srvCat.setContext(dragNodeId, null);
773771
srvCat.addListener("close", () => this.__removeTempEdge(), this);
@@ -1327,10 +1325,7 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
13271325
"text": "\uf090", // in
13281326
"action": () => {
13291327
const freePos = this.getStudy().getWorkbench().getFreePosition(nodeUI.getNode(), true);
1330-
const srvCat = this.openServiceCatalog({
1331-
x: 50,
1332-
y: 50
1333-
}, freePos);
1328+
const srvCat = this.openServiceCatalog(freePos);
13341329
if (srvCat) {
13351330
srvCat.setContext(null, nodeUI.getNodeId());
13361331
}
@@ -1340,10 +1335,7 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
13401335
"text": "\uf08b", // out
13411336
"action": () => {
13421337
const freePos = this.getStudy().getWorkbench().getFreePosition(nodeUI.getNode(), false);
1343-
const srvCat = this.openServiceCatalog({
1344-
x: 50,
1345-
y: 50
1346-
}, freePos);
1338+
const srvCat = this.openServiceCatalog(freePos);
13471339
if (srvCat) {
13481340
srvCat.setContext(nodeUI.getNodeId(), null);
13491341
}

0 commit comments

Comments
 (0)