1
- <template ></template >
2
-
3
1
<script >
4
2
/* external classes */
5
3
// is-warning
@@ -20,7 +18,7 @@ export default {
20
18
directories: [],
21
19
filterdList: [],
22
20
bulkList: [],
23
- showBy: undefined ,
21
+ showBy: null ,
24
22
currentFilterName: undefined ,
25
23
selectedFile: undefined ,
26
24
searchItemsCount: undefined ,
@@ -508,7 +506,7 @@ export default {
508
506
$ (' #file_loader' ).show ()
509
507
this .searchFor = ' '
510
508
this .showFilesOfType (' all' )
511
- this .showBy = undefined
509
+ this .showBy = null
512
510
513
511
var folder_location = ' '
514
512
@@ -527,11 +525,11 @@ export default {
527
525
this .selectFirst ()
528
526
$ (' #right' ).fadeIn ()
529
527
530
- for ( var i = this .allItemsCount - 1 ; i >= 0 ; i -- ) {
531
- if (typeof this . allFiles [i] .size !== ' undefined' ) {
532
- this . allFiles [i]. size = this .bytesToSize (this . allFiles [i] .size )
528
+ this .allFiles . map (( e ) => {
529
+ if (typeof e .size !== ' undefined' ) {
530
+ e . size = this .bytesToSize (e .size )
533
531
}
534
- }
532
+ })
535
533
})
536
534
537
535
// dirs list
@@ -606,11 +604,11 @@ export default {
606
604
})
607
605
608
606
// update folder count when folder is moved into another
609
- for ( var i = files .length - 1 ; i >= 0 ; i -- ) {
610
- if (files[i] .items && files[i] .items > 0 ) {
611
- this .updateFolderCount (destination, files[i] .items )
607
+ files .map (( e ) => {
608
+ if (e .items && e .items > 0 ) {
609
+ this .updateFolderCount (destination, e .items )
612
610
}
613
- }
611
+ })
614
612
615
613
$ (' #move_file_modal' ).modal (' hide' )
616
614
this .updateFoundCount (files .length )
@@ -769,29 +767,33 @@ export default {
769
767
770
768
/* Operations */
771
769
removeFromLists (name ) {
772
- var i = 0
773
-
774
770
if (this .filterdList .length ) {
775
- for (i = this .filterdList .length - 1 ; i >= 0 ; i-- ) {
776
- if (this .filterdList [i].name .includes (name)) {
777
- this .filterdList .splice (i, 1 )
771
+ let list = this .filterdList
772
+
773
+ list .map ((e ) => {
774
+ if (e .name .includes (name)) {
775
+ list .splice (list .indexOf (e), 1 )
778
776
}
779
- }
777
+ })
780
778
}
781
779
782
780
if (this .directories .length ) {
783
- for (i = this .directories .length - 1 ; i >= 0 ; i-- ) {
784
- if (this .directories [i].includes (name)) {
785
- this .directories .splice (i, 1 )
781
+ let list = this .directories
782
+
783
+ list .map ((e ) => {
784
+ if (e .includes (name)) {
785
+ list .splice (list .indexOf (e), 1 )
786
786
}
787
- }
787
+ })
788
788
}
789
789
790
- for (i = this .files .items .length - 1 ; i >= 0 ; i-- ) {
791
- if (this .files .items [i].name .includes (name)) {
792
- this .files .items .splice (i, 1 )
790
+ this .files .items .map ((e ) => {
791
+ if (e .name .includes (name)) {
792
+ let list = this .files .items
793
+
794
+ list .splice (list .indexOf (e), 1 )
793
795
}
794
- }
796
+ })
795
797
796
798
this .clearSelected ()
797
799
},
@@ -802,21 +804,19 @@ export default {
802
804
destination = destination .split (' /' ).shift ()
803
805
}
804
806
805
- var i = 0
806
-
807
807
if (this .filterdList .length ) {
808
- for (i = this .filterdList .length - 1 ; i >= 0 ; i -- ) {
809
- if (this . filterdList [i] .name .includes (destination)) {
810
- this . filterdList [i] .items += parseInt (count)
808
+ this .filterdList .map (( e ) => {
809
+ if (e .name .includes (destination)) {
810
+ e .items += parseInt (count)
811
811
}
812
- }
812
+ })
813
813
}
814
814
815
- for (i = this .files .items .length - 1 ; i >= 0 ; i -- ) {
816
- if (this . files . items [i] .name .includes (destination)) {
817
- this . files . items [i] .items += parseInt (count)
815
+ this .files .items .map (( e ) => {
816
+ if (e .name .includes (destination)) {
817
+ e .items += parseInt (count)
818
818
}
819
- }
819
+ })
820
820
}
821
821
},
822
822
updateItemName (item , oldName , newName ) {
@@ -937,13 +937,14 @@ export default {
937
937
showBy (val ) {
938
938
if (val) {
939
939
if (val == ' clear' ) {
940
- this .showBy = undefined
940
+ this .showBy = null
941
941
}
942
942
if (! this .isBulkSelecting ()) {
943
943
this .selectFirst ()
944
944
}
945
945
}
946
946
}
947
- }
947
+ },
948
+ render () {}
948
949
}
949
950
</script >
0 commit comments