Skip to content

Commit 558a358

Browse files
committed
disable button until requirements are met
1 parent aeeca3a commit 558a358

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ qx.Class.define("osparc.study.StudyOptions", {
130130
control = new qx.ui.form.TextField().set({
131131
maxWidth: 220
132132
});
133+
control.addListener("changeValue", () => this.__evaluateOpenButton());
133134
osparc.utils.Utils.setIdToWidget(control, "studyTitleField");
134135
this.getChildControl("title-layout").add(control);
135136
break;
@@ -227,7 +228,8 @@ qx.Class.define("osparc.study.StudyOptions", {
227228
minWidth: 150,
228229
maxWidth: 150,
229230
height: 35,
230-
center: true
231+
center: true,
232+
enabled: false,
231233
});
232234
osparc.utils.Utils.setIdToWidget(control, "openWithResources");
233235
this.getChildControl("buttons-layout").addAt(control, 1);
@@ -277,7 +279,13 @@ qx.Class.define("osparc.study.StudyOptions", {
277279
});
278280
}
279281

280-
this.getChildControl("open-button").setEnabled(Boolean(wallet));
282+
this.__evaluateOpenButton();
283+
},
284+
285+
__evaluateOpenButton: function() {
286+
const hasTitle = Boolean(this.getChildControl("title-field").getValue());
287+
const walletSelected = Boolean(this.getWallet());
288+
this.getChildControl("open-button").setEnabled(hasTitle && walletSelected);
281289
},
282290

283291
__buildLayout: function() {

0 commit comments

Comments
 (0)