diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-10-30 11:58:14 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-11-13 14:34:44 +0100 |
commit | 16e0887ec63591113ee3f476e0c5129e20180cde (patch) | |
tree | 1e479da654d785dd9a4ecf6454fe9b2a42425595 /apps/files/src | |
parent | d9204f61ead5f5c95cbef21a5d6fc40ac2d1861a (diff) | |
download | nextcloud-server-16e0887ec63591113ee3f476e0c5129e20180cde.tar.gz nextcloud-server-16e0887ec63591113ee3f476e0c5129e20180cde.zip |
Use function to open a sidebar file
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/src')
-rw-r--r-- | apps/files/src/services/Sidebar.js | 28 | ||||
-rw-r--r-- | apps/files/src/views/Sidebar.vue | 4 |
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) }, /** |