aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-10-23 18:40:48 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2019-10-29 13:20:08 +0100
commit3331cdd74abb89692c9d37ba503a9d36768ae7d9 (patch)
tree0604dc0d63aba55b0ecfc32642fea0248e7bf286
parent51960cb228760d79ed70996a7a87f8719af8230c (diff)
downloadnextcloud-server-3331cdd74abb89692c9d37ba503a9d36768ae7d9.tar.gz
nextcloud-server-3331cdd74abb89692c9d37ba503a9d36768ae7d9.zip
Fix legacy tab backbone fileinfo change
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
-rw-r--r--apps/files/src/components/LegacyTab.vue7
-rw-r--r--apps/files/src/views/Sidebar.vue20
2 files changed, 19 insertions, 8 deletions
diff --git a/apps/files/src/components/LegacyTab.vue b/apps/files/src/components/LegacyTab.vue
index 9a85ee7f073..54a24edcdd7 100644
--- a/apps/files/src/components/LegacyTab.vue
+++ b/apps/files/src/components/LegacyTab.vue
@@ -40,7 +40,6 @@ export default {
},
name: {
type: String,
- default: '',
required: true
},
fileInfo: {
@@ -74,10 +73,16 @@ export default {
}
}
},
+ beforeMount() {
+ this.setFileInfo(this.fileInfo)
+ },
mounted() {
// append the backbone element and set the FileInfo
this.component.$el.appendTo(this.$el)
},
+ beforeDestroy() {
+ this.component.remove()
+ },
methods: {
setFileInfo(fileInfo) {
this.component.setFileInfo(new OCA.Files.FileInfoModel(fileInfo))
diff --git a/apps/files/src/views/Sidebar.vue b/apps/files/src/views/Sidebar.vue
index 879f71d8a12..02913d36877 100644
--- a/apps/files/src/views/Sidebar.vue
+++ b/apps/files/src/views/Sidebar.vue
@@ -26,6 +26,7 @@
ref="sidebar"
v-bind="appSidebar"
@close="onClose"
+ @update:active="setActiveTab"
@update:starred="toggleStarred"
@[defaultActionListener].stop.prevent="onDefaultAction">
<!-- TODO: create a standard to allow multiple elements here? -->
@@ -50,6 +51,7 @@
:key="tab.id"
:component="tabComponent(tab).component"
:name="tab.name"
+ :dav-path="davPath"
:file-info="fileInfo" />
</template>
</AppSidebar>
@@ -121,13 +123,8 @@ export default {
* @param {string} id the tab id to set as active
* @returns {string} the current active tab
*/
- activeTab: {
- get: function() {
- return this.Sidebar.activeTab
- },
- set: function(id) {
- OCA.Files.Sidebar.activeTab = id
- }
+ activeTab() {
+ return this.Sidebar.activeTab
},
/**
@@ -295,6 +292,15 @@ export default {
},
/**
+ * Set current active tab
+ *
+ * @param {string} id tab unique id
+ */
+ setActiveTab(id) {
+ OCA.Files.Sidebar.activeTab = id
+ },
+
+ /**
* Toggle favourite state
* TODO: better implementation
*