File tree 1 file changed +11
-5
lines changed 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,17 @@ export default class Item extends Component {
17
17
return "item " + this . props . className ;
18
18
} ;
19
19
20
- onClick = ( ) => {
20
+ onClick = ( e ) => {
21
21
if ( TIMER !== null ) {
22
22
return this . runDoubleClick ( ) ;
23
23
}
24
- TIMER = setTimeout ( this . runSingleClick , 300 ) ;
24
+ const multi = e . ctrlKey ;
25
+ TIMER = setTimeout ( ( ) => this . runSingleClick ( multi ) , 300 ) ;
25
26
} ;
26
27
27
- runSingleClick = ( ) => {
28
+ runSingleClick = ( multi ) => {
28
29
this . killTimer ( ) ;
29
- this . select ( ) ;
30
+ this . select ( multi ) ;
30
31
} ;
31
32
32
33
runDoubleClick = ( ) => {
@@ -51,9 +52,14 @@ export default class Item extends Component {
51
52
}
52
53
} ;
53
54
54
- select = ( ) => {
55
+ select = ( multi ) => {
55
56
let item = this . props . item ;
56
57
58
+ if ( ! multi ) {
59
+ this . props . store . config . data . folders . forEach ( folder => { folder . selected = false ; } )
60
+ this . props . store . config . data . files . forEach ( file => { file . selected = false ; } )
61
+ }
62
+
57
63
if ( item . is_dir ) {
58
64
item = this . props . store . config . data . folders . find ( x => x === item ) ;
59
65
} else {
You can’t perform that action at this time.
0 commit comments