2222qx . 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