aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/src')
-rw-r--r--apps/files/src/services/Sidebar.js28
-rw-r--r--apps/files/src/views/Sidebar.vue4
2 files changed, 20 insertions, 12 deletions
diff --git a/apps/files/src/services/Sidebar.js b/apps/files/src/services/Sidebar.js
index 2bb836272fa..f2a1f8f2124 100644
--- a/apps/files/src/services/Sidebar.js
+++ b/apps/files/src/services/Sidebar.js
@@ -49,11 +49,10 @@ export default class Sidebar {
}
/**
- * @memberof Sidebar
* Register a new tab view
*
- * @param {Object} tab a new unregistered tab
* @memberof Sidebar
+ * @param {Object} tab a new unregistered tab
* @returns {Boolean}
*/
registerTab(tab) {
@@ -77,32 +76,41 @@ export default class Sidebar {
}
/**
- * Set the current sidebar file data
+ * Open the sidebar for the given file
*
- * @param {string} path the file path to load
* @memberof Sidebar
+ * @param {string} path the file path to load
*/
- set file(path) {
+ open(path) {
this.#state.file = path
}
/**
- * Set the current sidebar file data
+ * Close the sidebar
+ *
+ * @memberof Sidebar
+ */
+ close() {
+ this.#state.file = ''
+ }
+
+ /**
+ * Return current opened file
*
- * @returns {String} the current opened file
* @memberof Sidebar
+ * @returns {String} the current opened file
*/
get file() {
return this.#state.file
}
/**
- * Set the current sidebar tab
+ * Set the current visible sidebar tab
*
- * @param {string} id the tab unique id
* @memberof Sidebar
+ * @param {string} id the tab unique id
*/
- set activeTab(id) {
+ setActiveTab(id) {
this.#state.activeTab = id
}
diff --git a/apps/files/src/views/Sidebar.vue b/apps/files/src/views/Sidebar.vue
index 02913d36877..47a2174b8cb 100644
--- a/apps/files/src/views/Sidebar.vue
+++ b/apps/files/src/views/Sidebar.vue
@@ -261,7 +261,7 @@ export default {
},
onClose() {
this.resetData()
- OCA.Files.Sidebar.file = ''
+ OCA.Files.Sidebar.close()
},
resetData() {
this.error = null
@@ -297,7 +297,7 @@ export default {
* @param {string} id tab unique id
*/
setActiveTab(id) {
- OCA.Files.Sidebar.activeTab = id
+ OCA.Files.Sidebar.setActiveTab(id)
},
/**