Skip to content

Commit d129744

Browse files
committed
[skip ci] allowMultiselection
1 parent b5988fd commit d129744

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

services/static-webserver/client/source/class/osparc/file/FilePicker.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,8 @@ qx.Class.define("osparc.file.FilePicker", {
545545
flex: 1
546546
});
547547
treeFolderLayout.add(treeLayout, 0);
548-
const folderViewer = new osparc.file.FolderViewer();
548+
const allowMultiselection = false;
549+
const folderViewer = new osparc.file.FolderViewer(allowMultiselection);
549550
treeFolderLayout.add(folderViewer, 1);
550551

551552
filesTree.addListener("selectionChanged", () => {

services/static-webserver/client/source/class/osparc/file/FolderViewer.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
qx.Class.define("osparc.file.FolderViewer", {
2323
extend: qx.ui.core.Widget,
2424

25-
construct: function() {
25+
construct: function(allowMultiselection = true) {
2626
this.base(arguments);
2727

2828
this._setLayout(new qx.ui.layout.VBox(10));
@@ -32,7 +32,10 @@ qx.Class.define("osparc.file.FolderViewer", {
3232
const folderUpBtn = this.getChildControl("folder-up");
3333
folderUpBtn.addListener("execute", () => this.fireDataEvent("folderUp", this.getFolder()), this);
3434
this.getChildControl("folder-path");
35-
const multiSelectButton = this.getChildControl("multi-select-button");
35+
let multiSelectButton = null;
36+
if (allowMultiselection) {
37+
multiSelectButton = this.getChildControl("multi-select-button");
38+
}
3639
const iconsButton = this.getChildControl("view-options-icons");
3740
const listButton = this.getChildControl("view-options-list");
3841
const folderContent = this.getChildControl("folder-content");
@@ -47,7 +50,9 @@ qx.Class.define("osparc.file.FolderViewer", {
4750

4851
this.bind("folder", folderContent, "folder");
4952

50-
multiSelectButton.addListener("changeValue", e => folderContent.setMultiSelect(e.getData()));
53+
if (allowMultiselection) {
54+
multiSelectButton.addListener("changeValue", e => folderContent.setMultiSelect(e.getData()));
55+
}
5156
iconsButton.addListener("execute", () => folderContent.setMode("icons"));
5257
listButton.addListener("execute", () => folderContent.setMode("list"));
5358

0 commit comments

Comments
 (0)