@@ -31,6 +31,8 @@ export default class FilebrowserController {
31
31
vm . $onChanges = function ( changes ) {
32
32
if ( changes . user ) {
33
33
$scope . previousGridArrays = [ ] ;
34
+ $scope . initLoad = true ;
35
+ $scope . initExpanded = false ;
34
36
$scope . dirPipe ( $scope . tableState ) ;
35
37
}
36
38
if ( changes . ip ) {
@@ -77,9 +79,6 @@ export default class FilebrowserController {
77
79
vm . browserstate . path = $scope . previousGridArraysString ( ) ;
78
80
}
79
81
$scope . gridArrayLoading = true ;
80
- if ( $scope . deckGridData . length == 0 ) {
81
- $scope . initLoad = true ;
82
- }
83
82
if ( ! angular . isUndefined ( tableState ) ) {
84
83
$scope . tableState = tableState ;
85
84
const paginationParams = listViewService . getPaginationParams ( tableState . pagination , $scope . filesPerPage ) ;
@@ -124,12 +123,19 @@ export default class FilebrowserController {
124
123
$scope . ip . state == 'Prepared'
125
124
) {
126
125
for ( let i = 0 ; i < dir . data . length ; i ++ ) {
127
- if ( dir . data [ i ] . name == 'content' ) {
126
+ if ( dir . data [ i ] . name == 'content' || dir . data [ i ] . name == 'c' ) {
128
127
$scope . expandFile ( $scope . ip , dir . data [ i ] ) ;
129
128
$scope . initExpanded = true ;
130
129
break ;
131
130
}
132
131
}
132
+ if ( ! $scope . initExpanded ) {
133
+ $scope . deckGridData = dir . data ;
134
+ tableState . pagination . numberOfPages = dir . numberOfPages ; //set the number of pages so the pagination can update
135
+ $scope . gridArrayLoading = false ;
136
+ $scope . initLoad = false ;
137
+ $scope . openingNewPage = false ;
138
+ }
133
139
} else {
134
140
$scope . deckGridData = dir . data ;
135
141
tableState . pagination . numberOfPages = dir . numberOfPages ; //set the number of pages so the pagination can update
@@ -149,6 +155,8 @@ export default class FilebrowserController {
149
155
$scope . deckGridInit = function ( ip ) {
150
156
$scope . previousGridArrays = [ ] ;
151
157
if ( $scope . tableState ) {
158
+ $scope . initLoad = true ;
159
+ $scope . initExpanded = false ;
152
160
$scope . dirPipe ( $scope . tableState ) ;
153
161
$scope . selectedCards = [ ] ;
154
162
}
0 commit comments