Skip to content

Commit 8eedfd2

Browse files
committed
no magic numbers
1 parent 8d4b9d6 commit 8eedfd2

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

services/static-webserver/client/source/class/osparc/dashboard/GridButtonBase.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,19 @@ qx.Class.define("osparc.dashboard.GridButtonBase", {
4343
statics: {
4444
ITEM_WIDTH: 190,
4545
ITEM_HEIGHT: 220,
46-
PADDING: 10,
47-
TITLE_PADDING: 6,
46+
PADDING: 8,
4847
SPACING_IN: 5,
4948
SPACING: 15,
5049
THUMBNAIL_SIZE: 50,
5150
POS: {
5251
TITLE: {
5352
row: 0,
5453
column: 0,
55-
rowSpan: 1,
5654
colSpan: 4
5755
},
5856
THUMBNAIL: {
5957
row: 2,
6058
column: 0,
61-
rowSpan: 1,
6259
colSpan: 4
6360
},
6461
AVATAR_GROUP: {
@@ -72,7 +69,6 @@ qx.Class.define("osparc.dashboard.GridButtonBase", {
7269
FOOTER: {
7370
row: 5,
7471
column: 0,
75-
rowSpan: 1,
7672
colSpan: 4
7773
}
7874
},

services/static-webserver/client/source/class/osparc/dashboard/GridButtonItem.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,22 @@ qx.Class.define("osparc.dashboard.GridButtonItem", {
8181
layout = this.getChildControl("footer");
8282
layout.add(control, osparc.dashboard.GridButtonBase.FPOS.HITS);
8383
break;
84-
case "avatar-group":
85-
control = new osparc.ui.basic.AvatarGroup(24, "left", 150);
86-
layout = this.getChildControl("main-layout");
87-
layout.add(control, osparc.dashboard.GridButtonBase.POS.AVATAR_GROUP);
84+
case "avatar-group": {
85+
const maxWidth = osparc.dashboard.GridButtonBase.ITEM_WIDTH - osparc.dashboard.GridButtonBase.PADDING * 2;
86+
control = new osparc.ui.basic.AvatarGroup(24, "left", maxWidth).set({
87+
paddingLeft: osparc.dashboard.GridButtonBase.PADDING,
88+
});
89+
this.getChildControl("main-layout").add(control, osparc.dashboard.GridButtonBase.POS.AVATAR_GROUP);
8890
break;
91+
}
8992
case "tags":
9093
control = new qx.ui.container.Composite(new qx.ui.layout.Flow(5, 3)).set({
9194
anonymous: true,
9295
paddingLeft: osparc.dashboard.GridButtonBase.PADDING,
9396
paddingRight: osparc.dashboard.GridButtonBase.PADDING,
9497
paddingBottom: osparc.dashboard.GridButtonBase.PADDING / 2
9598
});
96-
layout = this.getChildControl("main-layout");
97-
layout.add(control, osparc.dashboard.GridButtonBase.POS.TAGS);
99+
this.getChildControl("main-layout").add(control, osparc.dashboard.GridButtonBase.POS.TAGS);
98100
break;
99101
case "menu-selection-stack":
100102
control = new qx.ui.container.Stack();

0 commit comments

Comments
 (0)