},
name: {
type: String,
- default: '',
required: true
},
fileInfo: {
}
}
},
+ 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))
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? -->
:key="tab.id"
:component="tabComponent(tab).component"
:name="tab.name"
+ :dav-path="davPath"
:file-info="fileInfo" />
</template>
</AppSidebar>
* @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
},
/**
}
},
+ /**
+ * Set current active tab
+ *
+ * @param {string} id tab unique id
+ */
+ setActiveTab(id) {
+ OCA.Files.Sidebar.activeTab = id
+ },
+
/**
* Toggle favourite state
* TODO: better implementation