diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-07-27 10:23:44 +0200 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2022-07-27 10:23:44 +0200 |
commit | 8be9b04981c4f0bdf0a2b8d424f55c797ad90a32 (patch) | |
tree | fb6783d017fc73e0f54435f464eda71ce0ebb169 /apps/files/js | |
parent | 97462295587f4016066264edb6eed5d5e17903f3 (diff) | |
download | nextcloud-server-8be9b04981c4f0bdf0a2b8d424f55c797ad90a32.tar.gz nextcloud-server-8be9b04981c4f0bdf0a2b8d424f55c797ad90a32.zip |
Remove legacy #dir element in files list
Removed legacy "#dir" input element in the DOM.
Apps should use OCA.Files.App.currentFileList or
OCA.Sharing.PublicApp.fileList and call getCurrentDirectory() to
retrieve the current directory and changeDirectory() to change it.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/filelist.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index ac590fe2d74..038082a1fd6 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -231,6 +231,7 @@ * @param options.dragOptions drag options, disabled by default * @param options.folderDropOptions folder drop options, disabled by default * @param options.scrollTo name of file to scroll to after the first load + * @param [options.dir='/'] current directory * @param {OC.Files.Client} [options.filesClient] files API client * @param {OC.Backbone.Model} [options.filesConfig] files app configuration * @private @@ -414,6 +415,10 @@ }); } + if (!_.isUndefined(options.dir)) { + this._setCurrentDir(options.dir || '/', false); + } + if(options.openFile) { // Wait for some initialisation process to be over before triggering the default action. _.defer(() => { @@ -2049,7 +2054,7 @@ * @return current directory */ getCurrentDirectory: function(){ - return this._currentDirectory || this.$el.find('#dir').val() || '/'; + return this._currentDirectory || '/'; }, /** * Returns the directory permissions @@ -2131,9 +2136,6 @@ } this._currentDirectory = targetDir; - // legacy stuff - this.$el.find('#dir').val(targetDir); - if (changeUrl !== false) { var params = { dir: targetDir, |