Skip to content

Commit 1fda302

Browse files
committed
wrokinish expanded
1 parent 1666334 commit 1fda302

File tree

1 file changed

+12
-10
lines changed
  • services/static-webserver/client/source/class/osparc/ui/table/rowrenderer

1 file changed

+12
-10
lines changed

services/static-webserver/client/source/class/osparc/ui/table/rowrenderer/ExpandSelection.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,20 @@ qx.Class.define("osparc.ui.table.rowrenderer.ExpandSelection", {
3131
updateDataRowElement : function(rowInfo, rowElem) {
3232
this.base(arguments, rowInfo, rowElem);
3333

34-
const messageCellPos = this.__expandableColPos;
35-
// extend collapse row
3634
const style = rowElem.style;
37-
if (rowInfo.selected) {
38-
const messageDiv = rowElem.children.item(messageCellPos);
39-
const expandedHeight = messageDiv.scrollHeight + "px";
40-
style.height = expandedHeight;
41-
Array.from(rowElem.children).forEach(child => child.style.height = expandedHeight);
42-
} else {
43-
// back to collapsed
44-
style.height = "19px";
35+
36+
const rowClicked = () => {
37+
// switch it's expanded if it was already expanded
38+
rowInfo.expanded = !rowInfo.expanded;
39+
40+
const messageDiv = rowElem.children.item(this.__expandableColPos);
41+
const expandedHeight = messageDiv.scrollHeight;
42+
const newHeight = (rowInfo.expanded ? expandedHeight : 19) + "px";
43+
style.height = newHeight
44+
Array.from(rowElem.children).forEach(child => child.style.height = newHeight);
4545
}
46+
rowElem.removeEventListener("click", rowClicked);
47+
rowElem.addEventListener("click", rowClicked);
4648
}
4749
}
4850
});

0 commit comments

Comments
 (0)