@@ -128,7 +128,9 @@ const createInitialPaths = (core, proc) => {
128
128
/**
129
129
* Formats file status message
130
130
*/
131
- const formatFileMessage = file => `${ file . filename } (${ file . size } bytes)` ;
131
+ const formatFileMessage = files => files
132
+ . map ( file => `${ file . filename } (${ file . size } bytes)` )
133
+ . join ( ', ' ) ;
132
134
133
135
/**
134
136
* Formats directory status message
@@ -332,7 +334,7 @@ const vfsActionFactory = (core, proc, win, dialog, state) => {
332
334
} catch ( error ) {
333
335
dialog ( 'error' , error , __ ( 'MSG_READDIR_ERROR' , dir . path ) ) ;
334
336
} finally {
335
- state . currentFile = undefined ;
337
+ state . currentFile = [ ] ;
336
338
win . setState ( 'loading' , false ) ;
337
339
}
338
340
} ;
@@ -659,7 +661,8 @@ const createApplication = (core, proc) => {
659
661
} ) ,
660
662
661
663
fileview : listView . state ( {
662
- columns : [ ]
664
+ columns : [ ] ,
665
+ multiselect : true
663
666
} )
664
667
} ;
665
668
@@ -696,12 +699,12 @@ const createApplication = (core, proc) => {
696
699
setStatus : status => ( { status} ) ,
697
700
setMinimalistic : minimalistic => ( { minimalistic} ) ,
698
701
setList : ( { list, path, selectFile} ) => ( { fileview, mountview} ) => {
699
- let selectedIndex ;
702
+ let selectedIndex = [ ] ;
700
703
701
704
if ( selectFile ) {
702
705
const foundIndex = list . findIndex ( file => file . filename === selectFile ) ;
703
706
if ( foundIndex !== - 1 ) {
704
- selectedIndex = foundIndex ;
707
+ selectedIndex = [ foundIndex ] ;
705
708
}
706
709
}
707
710
@@ -725,7 +728,7 @@ const createApplication = (core, proc) => {
725
728
726
729
fileview : listView . actions ( {
727
730
select : ( { data} ) => win . emit ( 'filemanager:select' , data ) ,
728
- activate : ( { data} ) => win . emit ( `filemanager:${ data . isFile ? 'open' : 'navigate' } ` , data ) ,
731
+ activate : ( { data} ) => data . forEach ( d => win . emit ( `filemanager:${ d . isFile ? 'open' : 'navigate' } ` , d ) ) ,
729
732
contextmenu : args => win . emit ( 'filemanager:contextmenu' , args ) ,
730
733
created : ( { el, data} ) => {
731
734
if ( data . isFile ) {
@@ -747,7 +750,7 @@ const createApplication = (core, proc) => {
747
750
*/
748
751
const createWindow = ( core , proc ) => {
749
752
let wired ;
750
- const state = { currentFile : undefined , currentPath : undefined } ;
753
+ const state = { currentFile : [ ] , currentPath : undefined } ;
751
754
const { homePath, initialPath} = createInitialPaths ( core , proc ) ;
752
755
753
756
const title = core . make ( 'osjs/locale' ) . translatableFlat ( proc . metadata . title ) ;
@@ -766,8 +769,8 @@ const createWindow = (core, proc) => {
766
769
const onDrop = ( ...args ) => vfs . drop ( ...args ) ;
767
770
const onHome = ( ) => vfs . readdir ( homePath , 'clear' ) ;
768
771
const onNavigate = ( ...args ) => vfs . readdir ( ...args ) ;
769
- const onSelectItem = file => ( state . currentFile = file ) ;
770
- const onSelectStatus = file => win . emit ( 'filemanager:status' , formatFileMessage ( file ) ) ;
772
+ const onSelectItem = files => ( state . currentFile = files ) ;
773
+ const onSelectStatus = files => win . emit ( 'filemanager:status' , formatFileMessage ( files ) ) ;
771
774
const onContextMenu = ( { ev, data} ) => createMenu ( { ev, name : 'edit' } , data , true ) ;
772
775
const onReaddirRender = args => wired . setList ( args ) ;
773
776
const onRefresh = ( ...args ) => vfs . refresh ( ...args ) ;
0 commit comments