File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 4040 */
4141 fileList : null ,
4242
43+ currentFileList : null ,
44+
4345 /**
4446 * Backbone model for storing files preferences
4547 */
116118 maxChunkSize : OC . appConfig . files && OC . appConfig . files . max_chunk_size
117119 }
118120 ) ;
121+ this . currentFileList = this . fileList
119122 this . files . initialize ( ) ;
120123
121124 // for backward compatibility, the global FileList will
166169 }
167170 } ,
168171
172+ /**
173+ * Set the currently active file list
174+ *
175+ * Due to the file list implementations being registered after clicking the
176+ * navigation item for the first time, OCA.Files.App is not aware of those until
177+ * they have initialized themselves. Therefore the files list needs to call this
178+ * method manually
179+ *
180+ * @param {OCA.Files.FileList } newFileList
181+ */
182+ updateCurrentFileList : function ( newFileList ) {
183+ this . currentFileList = newFileList ;
184+ } ,
185+
186+ /**
187+ * Return the currently active file list
188+ * @return {OCA.Files.FileList }
189+ */
190+ getCurrentFileList : function ( ) {
191+ return this . currentFileList ;
192+ } ,
193+
169194 /**
170195 * Returns the container of the currently visible app.
171196 *
Original file line number Diff line number Diff line change 408408
409409
410410 OC . Plugins . attach ( 'OCA.Files.FileList' , this ) ;
411+
412+ OCA . Files . App && OCA . Files . App . updateCurrentFileList ( this ) ;
411413 } ,
412414
413415 /**
683685 * Event handler when leaving previously hidden state
684686 */
685687 _onShow : function ( e ) {
688+ OCA . Files . App && OCA . Files . App . updateCurrentFileList ( this ) ;
686689 if ( this . shown ) {
687690 if ( e . itemId === this . id ) {
688691 this . _setCurrentDir ( '/' , false ) ;
You can’t perform that action at this time.
0 commit comments