Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-10-14 21:02:51 +0300
committerJulius Härtl <jus@bitgrid.net>2020-08-25 23:42:44 +0300
commitd5e854e7efda5572682988faeef500e6f71a7b57 (patch)
tree4e7a019189a4d54093cb268facf760ad272b2bf9 /apps/files/js/app.js
parented5b90b38ac24efca5d16231ca1e8657fb57a0c8 (diff)
Expose currently active file list though OCA.Files.App
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files/js/app.js')
-rw-r--r--apps/files/js/app.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/apps/files/js/app.js b/apps/files/js/app.js
index a6b656311d5..09468205279 100644
--- a/apps/files/js/app.js
+++ b/apps/files/js/app.js
@@ -40,6 +40,8 @@
*/
fileList: null,
+ currentFileList: null,
+
/**
* Backbone model for storing files preferences
*/
@@ -112,6 +114,7 @@
maxChunkSize: OC.appConfig.files && OC.appConfig.files.max_chunk_size
}
);
+ this.updateCurrentFileList(this.fileList)
this.files.initialize();
// for backward compatibility, the global FileList will
@@ -161,6 +164,28 @@
},
/**
+ * 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.
*
* @return app container