*/
fileList: null,
+ currentFileList: null,
+
/**
* Backbone model for storing files preferences
*/
maxChunkSize: OC.appConfig.files && OC.appConfig.files.max_chunk_size
}
);
+ this.updateCurrentFileList(this.fileList)
this.files.initialize();
// for backward compatibility, the global FileList will
}
},
+ /**
+ * Set the currently active file list
+ *
+ * Due to the file list implementations being registered after clicking the
+ * navigation item for the first time, OCA.Files.App is not aware of those until
+ * they have initialized themselves. Therefore the files list needs to call this
+ * method manually
+ *
+ * @param {OCA.Files.FileList} newFileList
+ */
+ updateCurrentFileList: function(newFileList) {
+ this.currentFileList = newFileList;
+ },
+
+ /**
+ * Return the currently active file list
+ * @return {?OCA.Files.FileList}
+ */
+ getCurrentFileList: function () {
+ return this.currentFileList;
+ },
+
/**
* Returns the container of the currently visible app.
*
OC.Plugins.attach('OCA.Files.FileList', this);
+ OCA.Files.App && OCA.Files.App.updateCurrentFileList(this);
+
this.initHeadersAndFooters()
},
* Event handler when leaving previously hidden state
*/
_onShow: function(e) {
+ OCA.Files.App && OCA.Files.App.updateCurrentFileList(this);
if (this.shown) {
if (e.itemId === this.id) {
this._setCurrentDir('/', false);