Skip to content

Commit a87a209

Browse files
committed
minor
1 parent 6a787f7 commit a87a209

File tree

1 file changed

+13
-14
lines changed
  • services/static-webserver/client/source/class/osparc/widget

1 file changed

+13
-14
lines changed

services/static-webserver/client/source/class/osparc/widget/Renamer.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ qx.Class.define("osparc.widget.Renamer", {
4040
construct: function(oldLabel = "", subtitle = "", winTitle) {
4141
this.base(arguments, winTitle || this.tr("Rename"));
4242

43-
const maxWidth = 350;
44-
const minWidth = 200;
43+
const maxWidth = 400;
44+
const minWidth = 250;
4545
const labelWidth = oldLabel ? Math.min(Math.max(parseInt(oldLabel.length*4), minWidth), maxWidth) : minWidth;
4646
this.set({
4747
layout: new qx.ui.layout.VBox(5),
@@ -93,13 +93,6 @@ qx.Class.define("osparc.widget.Renamer", {
9393
appearance: "form-button",
9494
padding: [1, 5]
9595
});
96-
control.addListener("execute", () => {
97-
const newLabel = this.getChildControl("text-field").getValue();
98-
const data = {
99-
newLabel
100-
};
101-
this.fireDataEvent("labelChanged", data);
102-
}, this);
10396
this.getChildControl("main-layout").add(control);
10497
break;
10598
case "subtitle":
@@ -113,23 +106,29 @@ qx.Class.define("osparc.widget.Renamer", {
113106
},
114107

115108
__populateNodeLabelEditor: function(oldLabel, labelWidth) {
116-
const nodeLabelEditor = new qx.ui.container.Composite(new qx.ui.layout.HBox(10));
117-
118109
// Create a text field in which to edit the data
119110
const textField = this.getChildControl("text-field").set({
120111
value: oldLabel,
121112
minWidth: labelWidth,
122113
});
123114

115+
// Create the "Save" button to close the cell editor
116+
const saveButton = this.getChildControl("save-button");
117+
118+
saveButton.addListener("execute", () => {
119+
const newLabel = textField.getValue();
120+
const data = {
121+
newLabel
122+
};
123+
this.fireDataEvent("labelChanged", data);
124+
}, this);
125+
124126
this.addListener("appear", e => {
125127
textField.focus();
126128
if (textField.getValue()) {
127129
textField.setTextSelection(0, textField.getValue().length);
128130
}
129131
}, this);
130-
131-
// Create the "Save" button to close the cell editor
132-
this.getChildControl("save-button");
133132
},
134133

135134
__applyMaxChars: function(value) {

0 commit comments

Comments
 (0)