2019-05-23 18:03:04 +03:00
|
|
|
<!--
|
|
|
|
- @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
|
|
|
-
|
|
|
|
- @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
|
|
-
|
|
|
|
- @license GNU AGPL version 3 or any later version
|
|
|
|
-
|
|
|
|
- This program is free software: you can redistribute it and/or modify
|
|
|
|
- it under the terms of the GNU Affero General Public License as
|
|
|
|
- published by the Free Software Foundation, either version 3 of the
|
|
|
|
- License, or (at your option) any later version.
|
|
|
|
-
|
|
|
|
- This program is distributed in the hope that it will be useful,
|
|
|
|
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
- GNU Affero General Public License for more details.
|
|
|
|
-
|
|
|
|
- You should have received a copy of the GNU Affero General Public License
|
|
|
|
- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
-
|
|
|
|
-->
|
|
|
|
|
|
|
|
<template>
|
2020-01-29 18:31:47 +03:00
|
|
|
<AppSidebarTab
|
|
|
|
:id="id"
|
|
|
|
:icon="icon"
|
2019-05-23 18:03:04 +03:00
|
|
|
:name="name"
|
|
|
|
:active-tab="activeTab" />
|
|
|
|
</template>
|
|
|
|
<script>
|
2020-01-16 02:03:29 +03:00
|
|
|
import AppSidebarTab from '@nextcloud/vue/dist/Components/AppSidebarTab'
|
2019-05-23 18:03:04 +03:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'LegacyTab',
|
|
|
|
components: {
|
2020-07-31 10:26:43 +03:00
|
|
|
AppSidebarTab,
|
2019-05-23 18:03:04 +03:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
component: {
|
|
|
|
type: Object,
|
2019-11-13 15:05:10 +03:00
|
|
|
required: true,
|
2019-05-23 18:03:04 +03:00
|
|
|
},
|
2020-01-29 18:31:47 +03:00
|
|
|
id: {
|
2019-05-23 18:03:04 +03:00
|
|
|
type: String,
|
2019-11-13 15:05:10 +03:00
|
|
|
required: true,
|
2019-05-23 18:03:04 +03:00
|
|
|
},
|
|
|
|
fileInfo: {
|
|
|
|
type: Object,
|
|
|
|
default: () => {},
|
2019-11-13 15:05:10 +03:00
|
|
|
required: true,
|
|
|
|
},
|
2019-05-23 18:03:04 +03:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
icon() {
|
|
|
|
return this.component.getIcon()
|
|
|
|
},
|
2020-01-29 18:31:47 +03:00
|
|
|
name() {
|
|
|
|
return this.component.getLabel()
|
2019-05-23 18:03:04 +03:00
|
|
|
},
|
|
|
|
order() {
|
|
|
|
return this.component.order
|
|
|
|
? this.component.order
|
|
|
|
: 0
|
|
|
|
},
|
|
|
|
// needed because AppSidebarTab also uses $parent.activeTab
|
|
|
|
activeTab() {
|
|
|
|
return this.$parent.activeTab
|
2019-11-13 15:05:10 +03:00
|
|
|
},
|
2019-05-23 18:03:04 +03:00
|
|
|
},
|
|
|
|
watch: {
|
2020-04-19 23:41:40 +03:00
|
|
|
fileInfo(fileInfo) {
|
|
|
|
if (fileInfo) {
|
|
|
|
this.setFileInfo(fileInfo)
|
2019-05-23 18:03:04 +03:00
|
|
|
}
|
2019-11-13 15:05:10 +03:00
|
|
|
},
|
2019-05-23 18:03:04 +03:00
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
// append the backbone element and set the FileInfo
|
|
|
|
this.component.$el.appendTo(this.$el)
|
|
|
|
},
|
2019-10-23 19:40:48 +03:00
|
|
|
beforeDestroy() {
|
|
|
|
this.component.remove()
|
|
|
|
},
|
2019-05-23 18:03:04 +03:00
|
|
|
methods: {
|
|
|
|
setFileInfo(fileInfo) {
|
|
|
|
this.component.setFileInfo(new OCA.Files.FileInfoModel(fileInfo))
|
2019-11-13 15:05:10 +03:00
|
|
|
},
|
|
|
|
},
|
2019-05-23 18:03:04 +03:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style>
|
|
|
|
</style>
|