Skip to content

Commit a50c439

Browse files
committed
minor fixes
1 parent 409a62c commit a50c439

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

services/static-webserver/client/source/class/osparc/vipMarket/AnatomicalModelDetails.js

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -74,26 +74,36 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
7474
},
7575

7676
__createModelInfo: function(anatomicalModelsDataSource) {
77-
const cardGrid = new qx.ui.layout.Grid(16, 16);
78-
const cardLayout = new qx.ui.container.Composite(cardGrid);
77+
const cardLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(16));
7978

8079
const description = anatomicalModelsDataSource["description"] || "";
81-
description.split(" - ").forEach((desc, idx) => {
80+
const delimiter = " - ";
81+
let titleAndSubtitle = description.split(delimiter);
82+
if (titleAndSubtitle.length > 0) {
8283
const titleLabel = new qx.ui.basic.Label().set({
83-
value: desc,
84+
value: titleAndSubtitle[0],
8485
font: "text-16",
85-
alignX: "center",
8686
alignY: "middle",
8787
allowGrowX: true,
8888
allowGrowY: true,
8989
});
90-
cardLayout.add(titleLabel, {
91-
column: 0,
92-
row: idx,
93-
colSpan: 2,
90+
cardLayout.add(titleLabel);
91+
titleAndSubtitle.shift();
92+
}
93+
if (titleAndSubtitle.length > 0) {
94+
titleAndSubtitle = titleAndSubtitle.join(delimiter);
95+
const subtitleLabel = new qx.ui.basic.Label().set({
96+
value: titleAndSubtitle,
97+
font: "text-16",
98+
alignY: "middle",
99+
allowGrowX: true,
100+
allowGrowY: true,
94101
});
95-
});
102+
cardLayout.add(subtitleLabel);
103+
}
104+
96105

106+
const middleLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox(16));
97107
const thumbnail = new qx.ui.basic.Image().set({
98108
source: anatomicalModelsDataSource["thumbnail"],
99109
alignY: "middle",
@@ -105,10 +115,7 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
105115
maxWidth: 256,
106116
maxHeight: 256,
107117
});
108-
cardLayout.add(thumbnail, {
109-
column: 0,
110-
row: 2,
111-
});
118+
middleLayout.add(thumbnail);
112119

113120
const features = anatomicalModelsDataSource["features"];
114121
const featuresGrid = new qx.ui.layout.Grid(8, 8);
@@ -181,10 +188,9 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
181188
row: idx,
182189
});
183190

184-
cardLayout.add(featuresLayout, {
185-
column: 1,
186-
row: 2,
187-
});
191+
middleLayout.add(featuresLayout);
192+
193+
cardLayout.add(middleLayout);
188194

189195
return cardLayout;
190196
},

0 commit comments

Comments
 (0)