2018-02-16 07:04:18 +02:00
|
|
|
<template>
|
|
|
|
<div class="mk-drive-page">
|
2018-02-20 16:37:35 +02:00
|
|
|
<mk-drive :init-folder="folder" @move-root="onMoveRoot" @open-folder="onOpenFolder"/>
|
2018-02-16 07:04:18 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
export default Vue.extend({
|
2018-02-20 16:37:35 +02:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
folder: null
|
|
|
|
};
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.folder = this.$route.params.folder;
|
|
|
|
},
|
2018-02-16 07:04:18 +02:00
|
|
|
mounted() {
|
2018-05-20 00:36:26 +03:00
|
|
|
document.title = '%i18n:@title%';
|
2018-02-16 07:04:18 +02:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onMoveRoot() {
|
2018-05-20 00:36:26 +03:00
|
|
|
const title = '%i18n:@title%';
|
2018-02-16 07:04:18 +02:00
|
|
|
|
|
|
|
// Rewrite URL
|
|
|
|
history.pushState(null, title, '/i/drive');
|
|
|
|
|
|
|
|
document.title = title;
|
|
|
|
},
|
|
|
|
onOpenFolder(folder) {
|
2018-05-20 00:36:26 +03:00
|
|
|
const title = folder.name + ' | %i18n:@title%';
|
2018-02-16 07:04:18 +02:00
|
|
|
|
|
|
|
// Rewrite URL
|
|
|
|
history.pushState(null, title, '/i/drive/folder/' + folder.id);
|
|
|
|
|
|
|
|
document.title = title;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
|
|
|
.mk-drive-page
|
|
|
|
position fixed
|
|
|
|
width 100%
|
|
|
|
height 100%
|
|
|
|
background #fff
|
|
|
|
|
|
|
|
> .mk-drive
|
|
|
|
height 100%
|
|
|
|
</style>
|