Skip to content

Commit 3ed14f7

Browse files
committed
makeItemResponsive
1 parent 9755a2a commit 3ed14f7

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ qx.Class.define("osparc.dashboard.ListButtonItem", {
9494
break;
9595
case "tsr-rating":
9696
control = osparc.dashboard.CardBase.createTSRLayout();
97+
this.__makeItemResponsive(control);
9798
this._add(control, {
9899
row: 0,
99100
column: osparc.dashboard.ListButtonBase.POS.TSR
@@ -223,7 +224,7 @@ qx.Class.define("osparc.dashboard.ListButtonItem", {
223224
const label = this.getChildControl("owner");
224225
const user = this.createOwner(value);
225226
label.setValue(user);
226-
label.setVisibility(value ? "visible" : "excluded");
227+
this.__makeItemResponsive(label);
227228
return;
228229
},
229230

@@ -260,6 +261,18 @@ qx.Class.define("osparc.dashboard.ListButtonItem", {
260261
}
261262
},
262263

264+
__makeItemResponsive: function(item) {
265+
[
266+
"appear",
267+
"resize",
268+
].forEach(ev => {
269+
this.addListener(ev, () => {
270+
const bounds = this.getBounds() || this.getSizeHint();
271+
item.setVisibility(bounds.width > 700 ? "visible" : "excluded");
272+
});
273+
});
274+
},
275+
263276
// overridden
264277
_applyMultiSelectionMode: function(value) {
265278
if (value) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
255255
"appear",
256256
"resize",
257257
].forEach(ev => {
258-
container.addListener(ev, e => {
259-
const data = e.getData();
260-
card.setWidth(data.width);
258+
container.addListener(ev, () => {
259+
const bounds = container.getBounds() || container.getSizeHint();
260+
card.setWidth(bounds.width);
261261
});
262262
});
263263
}

0 commit comments

Comments
 (0)