2018-02-15 23:04:18 -06:00
|
|
|
<template>
|
|
|
|
<div class="mk-drive-page">
|
2018-11-11 14:35:09 -06:00
|
|
|
<x-drive :init-folder="folder" @move-root="onMoveRoot" @open-folder="onOpenFolder"/>
|
2018-02-15 23:04:18 -06:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2018-11-08 12:44:35 -06:00
|
|
|
import i18n from '../../../i18n';
|
|
|
|
|
2018-02-15 23:04:18 -06:00
|
|
|
export default Vue.extend({
|
2018-11-08 12:44:35 -06:00
|
|
|
i18n: i18n('desktop/views/pages/drive.vue'),
|
2018-11-11 14:35:09 -06:00
|
|
|
components: {
|
|
|
|
XDrive: () => import('../components/drive.vue').then(m => m.default),
|
|
|
|
},
|
2018-02-20 08:37:35 -06:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
folder: null
|
|
|
|
};
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.folder = this.$route.params.folder;
|
|
|
|
},
|
2018-02-15 23:04:18 -06:00
|
|
|
mounted() {
|
2018-11-08 12:44:35 -06:00
|
|
|
document.title = this.$t('title');
|
2018-02-15 23:04:18 -06:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onMoveRoot() {
|
2018-11-08 12:44:35 -06:00
|
|
|
const title = this.$t('title');
|
2018-02-15 23:04:18 -06:00
|
|
|
|
|
|
|
// Rewrite URL
|
|
|
|
history.pushState(null, title, '/i/drive');
|
|
|
|
|
|
|
|
document.title = title;
|
|
|
|
},
|
|
|
|
onOpenFolder(folder) {
|
2018-05-19 16:36:26 -05:00
|
|
|
const title = folder.name + ' | %i18n:@title%';
|
2018-02-15 23:04:18 -06:00
|
|
|
|
|
|
|
// Rewrite URL
|
2018-09-01 09:12:51 -05:00
|
|
|
history.pushState(null, title, `/i/drive/folder/${folder.id}`);
|
2018-02-15 23:04:18 -06:00
|
|
|
|
|
|
|
document.title = title;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
|
|
|
.mk-drive-page
|
|
|
|
position fixed
|
|
|
|
width 100%
|
|
|
|
height 100%
|
|
|
|
background #fff
|
|
|
|
|
|
|
|
> .mk-drive
|
|
|
|
height 100%
|
|
|
|
</style>
|