Skip to content

Commit e4820a5

Browse files
committed
more scrolling
1 parent 2dbfe09 commit e4820a5

File tree

1 file changed

+14
-13
lines changed
  • services/static-webserver/client/source/class/osparc/desktop/preferences/pages

1 file changed

+14
-13
lines changed

services/static-webserver/client/source/class/osparc/desktop/preferences/pages/TagsPage.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,20 @@ qx.Class.define("osparc.desktop.preferences.pages.TagsPage", {
2626

2727
this._add(new qx.ui.core.Spacer(null, 10));
2828

29-
this.__container = new qx.ui.container.Composite(new qx.ui.layout.VBox(10));
30-
this.__container.set({
29+
this.__tagsContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox(10));
30+
this.__tagsContainer.set({
3131
paddingLeft: 10
3232
});
33-
const scroll = new qx.ui.container.Scroll(this.__container);
34-
this._add(scroll);
33+
const scroll = new qx.ui.container.Scroll(this.__tagsContainer);
34+
this._add(scroll, {
35+
flex: 1
36+
});
3537

3638
this.__createComponents();
3739
},
3840

3941
members: {
40-
__container: null,
42+
__tagsContainer: null,
4143
__addTagButton: null,
4244
__tagItems: null,
4345

@@ -55,35 +57,34 @@ qx.Class.define("osparc.desktop.preferences.pages.TagsPage", {
5557
},
5658

5759
__renderLayout: function() {
58-
this.__container.removeAll();
60+
this.__tagsContainer.removeAll();
5961

6062
// Print tag items
61-
this.__tagItems.forEach(tagItem => this.__container.add(tagItem));
63+
this.__tagItems.forEach(tagItem => this.__tagsContainer.add(tagItem));
6264

6365
// New tag button
6466
const buttonContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox().set({
6567
alignX: "center"
6668
}));
67-
buttonContainer.add(new qx.ui.core.Spacer(null, 10));
6869
buttonContainer.add(this.__addTagButton);
69-
this.__container.add(buttonContainer);
70+
this._add(buttonContainer);
7071
},
7172

7273
__attachEventHandlers: function() {
7374
this.__addTagButton.addListener("execute", () => {
74-
const itemCount = this.__container.getChildren().length;
75+
const itemCount = this.__tagsContainer.getChildren().length;
7576
const newItem = new osparc.form.tag.TagItem().set({
7677
mode: osparc.form.tag.TagItem.modes.EDIT
7778
});
7879
this.__attachTagItemEvents(newItem);
79-
this.__container.addAt(newItem, Math.max(0, itemCount - 1));
80+
this.__tagsContainer.addAt(newItem, Math.max(0, itemCount - 1));
8081
});
8182
this.__tagItems.forEach(tagItem => this.__attachTagItemEvents(tagItem));
8283
},
8384

8485
__attachTagItemEvents: function(tagItem) {
85-
tagItem.addListener("cancelNewTag", e => this.__container.remove(e.getTarget()), this);
86-
tagItem.addListener("deleteTag", e => this.__container.remove(e.getTarget()));
86+
tagItem.addListener("cancelNewTag", e => this.__tagsContainer.remove(e.getTarget()), this);
87+
tagItem.addListener("deleteTag", e => this.__tagsContainer.remove(e.getTarget()));
8788
}
8889
}
8990
});

0 commit comments

Comments
 (0)