forked from FoundKeyGang/FoundKey
wip
This commit is contained in:
parent
131bbce66e
commit
02f3d8b0e0
2 changed files with 45 additions and 37 deletions
|
@ -1,37 +0,0 @@
|
|||
<mk-drive-page>
|
||||
<mk-drive-browser ref="browser" folder={ opts.folder }/>
|
||||
<style lang="stylus" scoped>
|
||||
:scope
|
||||
display block
|
||||
position fixed
|
||||
width 100%
|
||||
height 100%
|
||||
background #fff
|
||||
|
||||
> mk-drive-browser
|
||||
height 100%
|
||||
</style>
|
||||
<script lang="typescript">
|
||||
this.on('mount', () => {
|
||||
document.title = 'Misskey Drive';
|
||||
|
||||
this.$refs.browser.on('move-root', () => {
|
||||
const title = 'Misskey Drive';
|
||||
|
||||
// Rewrite URL
|
||||
history.pushState(null, title, '/i/drive');
|
||||
|
||||
document.title = title;
|
||||
});
|
||||
|
||||
this.$refs.browser.on('open-folder', folder => {
|
||||
const title = folder.name + ' | Misskey Drive';
|
||||
|
||||
// Rewrite URL
|
||||
history.pushState(null, title, '/i/drive/folder/' + folder.id);
|
||||
|
||||
document.title = title;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</mk-drive-page>
|
45
src/web/app/desktop/views/pages/drive.vue
Normal file
45
src/web/app/desktop/views/pages/drive.vue
Normal file
|
@ -0,0 +1,45 @@
|
|||
<template>
|
||||
<div class="mk-drive-page">
|
||||
<mk-drive :folder="folder" @move-root="onMoveRoot" @open-folder="onOpenFolder"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
export default Vue.extend({
|
||||
props: ['folder'],
|
||||
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>
|
||||
|
Loading…
Reference in a new issue