egirlskey/src/client/app/desktop/views/pages/drive.vue

53 lines
889 B
Vue
Raw Normal View History

2018-02-16 05:04:18 +00:00
<template>
<div class="mk-drive-page">
2018-02-20 14:37:35 +00:00
<mk-drive :init-folder="folder" @move-root="onMoveRoot" @open-folder="onOpenFolder"/>
2018-02-16 05:04:18 +00:00
</div>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
2018-02-20 14:37:35 +00:00
data() {
return {
folder: null
};
},
created() {
this.folder = this.$route.params.folder;
},
2018-02-16 05:04:18 +00:00
mounted() {
document.title = 'Misskey Drive';
},
methods: {
onMoveRoot() {
const title = 'Misskey Drive';
// Rewrite URL
history.pushState(null, title, '/i/drive');
document.title = title;
},
onOpenFolder(folder) {
const title = folder.name + ' | Misskey Drive';
// 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>