Skip to content

Commit 5a8a527

Browse files
committed
add remove attribute
1 parent d830ee0 commit 5a8a527

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

services/static-webserver/client/source/class/osparc/study/StudyOptions.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ qx.Class.define("osparc.study.StudyOptions", {
232232
center: true,
233233
enabled: false,
234234
});
235-
osparc.utils.Utils.setIdToWidget(control, "openWithResources");
236235
this.getChildControl("buttons-layout").addAt(control, 1);
237236
break;
238237
}
@@ -284,7 +283,13 @@ qx.Class.define("osparc.study.StudyOptions", {
284283
__evaluateOpenButton: function() {
285284
const hasTitle = Boolean(this.getChildControl("title-field").getValue());
286285
const walletSelected = Boolean(this.getChildControl("wallet-selector").getSelection().length);
287-
this.getChildControl("open-button").setEnabled(hasTitle && walletSelected);
286+
const openButton = this.getChildControl("open-button");
287+
openButton.setEnabled(hasTitle && walletSelected);
288+
if (hasTitle && walletSelected) {
289+
osparc.utils.Utils.setIdToWidget(openButton, "openWithResources");
290+
} else {
291+
osparc.utils.Utils.removeIdAttribute(openButton);
292+
}
288293
},
289294

290295
__buildLayout: function() {

services/static-webserver/client/source/class/osparc/utils/Utils.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,13 @@ qx.Class.define("osparc.utils.Utils", {
10341034
return null;
10351035
},
10361036

1037+
removeIdAttribute: qWidget => {
1038+
if (qWidget.getContentElement && qWidget.getContentElement()) {
1039+
return qWidget.getContentElement().removeAttribute("osparc-test-id");
1040+
}
1041+
return null;
1042+
},
1043+
10371044
setKeyToWidget: (qWidget, id) => {
10381045
if (qWidget.getContentElement && qWidget.getContentElement()) {
10391046
qWidget.getContentElement().setAttribute("osparc-test-key", id);

0 commit comments

Comments
 (0)