summaryrefslogtreecommitdiffstats
path: root/apps/files/src/services/Sidebar.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/src/services/Sidebar.js')
-rw-r--r--apps/files/src/services/Sidebar.js28
1 files changed, 18 insertions, 10 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
}