Skip to content

Commit

Permalink
Merge branch 'master' into enh/react-to-5xx
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz authored Oct 2, 2024
2 parents 41bb1b5 + 8118841 commit 319b473
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ qx.Class.define("osparc.workbench.BaseNodeUI", {
appearance: {
init: "window-small-cap",
refine: true
},

isMovable: {
check: "Boolean",
init: true,
nullable: false
}
},

Expand Down Expand Up @@ -272,7 +278,7 @@ qx.Class.define("osparc.workbench.BaseNodeUI", {
// override qx.ui.core.MMovable
_onMovePointerMove: function(e) {
// Only react when dragging is active
if (!this.hasState("move")) {
if (!this.hasState("move") || !this.getIsMovable()) {
return;
}
e.stopPropagation();
Expand All @@ -290,7 +296,7 @@ qx.Class.define("osparc.workbench.BaseNodeUI", {
}

// Only react when dragging is active
if (!this.hasState("move")) {
if (!this.hasState("move") || !this.getIsMovable()) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ qx.Class.define("osparc.workbench.NodeUI", {
// override qx.ui.core.MMovable
_onMovePointerMove: function(e) {
// Only react when dragging is active
if (!this.hasState("move")) {
if (!this.hasState("move") || !this.getIsMovable()) {
return;
}
const coords = this._setPositionFromEvent(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,9 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
nodeUI.addListener("requestOpenLogger", () => this.fireDataEvent("requestOpenLogger", nodeUI.getNodeId()), this);

nodeUI.addListener("nodeMovingStart", () => {
this.__selectNode(nodeUI);
if (!this.getSelectedNodeIDs().includes(nodeUI.getNodeId())) {
this.__selectNode(nodeUI);
}
this.__itemStartedMoving();
}, this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ qx.Class.define("osparc.workbench.WorkbenchUIPreview", {
for (const nodeId in nodes) {
const node = nodes[nodeId];
const nodeUI = this._createNodeUI(nodeId);
nodeUI.setIsMovable(false);
this._addNodeUIToWorkbench(nodeUI, node.getPosition());
}
qx.ui.core.queue.Layout.flush();
Expand Down

0 comments on commit 319b473

Please sign in to comment.