From 8be9b04981c4f0bdf0a2b8d424f55c797ad90a32 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 27 Jul 2022 10:23:44 +0200 Subject: [PATCH] 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 --- apps/files/js/filelist.js | 10 ++++--- apps/files/templates/list.php | 1 - apps/files/templates/recentlist.php | 2 -- apps/files/templates/simplelist.php | 2 -- apps/files/tests/js/favoritesfilelistspec.js | 1 - apps/files/tests/js/fileactionsSpec.js | 4 +-- apps/files/tests/js/fileactionsmenuSpec.js | 4 +-- apps/files/tests/js/filelistSpec.js | 30 +++++++++---------- apps/files_external/js/statusmanager.js | 2 +- apps/files_external/templates/list.php | 2 -- .../tests/js/mountsfilelistSpec.js | 1 - apps/files_sharing/js/public.js | 3 +- apps/files_sharing/templates/list.php | 2 -- apps/files_sharing/templates/public.php | 2 -- apps/files_sharing/tests/js/publicAppSpec.js | 5 +++- apps/files_trashbin/templates/index.php | 2 -- apps/files_trashbin/tests/js/filelistSpec.js | 8 ----- apps/systemtags/templates/list.php | 1 - .../tests/js/systemtagsfilelistSpec.js | 1 - 19 files changed, 32 insertions(+), 51 deletions(-) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index ac590fe2d74f8..038082a1fd626 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, diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php index 19365c67722b3..1b45129195b2a 100644 --- a/apps/files/templates/list.php +++ b/apps/files/templates/list.php @@ -71,7 +71,6 @@ -
diff --git a/apps/files/templates/recentlist.php b/apps/files/templates/recentlist.php index 925201e5df6e1..994dadc2ba432 100644 --- a/apps/files/templates/recentlist.php +++ b/apps/files/templates/recentlist.php @@ -2,8 +2,6 @@ - - - -