misskey/src/client/app/mobile/views/components/drive-file-chooser.vue

106 lines
1.9 KiB
Vue
Raw Normal View History

2018-02-17 01:30:11 +09:00
<template>
<div class="cdxzvcfawjxdyxsekbxbfgtplebnoneb">
2018-02-17 01:30:11 +09:00
<div class="body">
<header>
<h1>{{ $t('select-file') }}<span class="count" v-if="files.length > 0">({{ files.length }})</span></h1>
<button class="close" @click="cancel"><fa icon="times"/></button>
<button v-if="multiple" class="ok" @click="ok"><fa icon="check"/></button>
2018-02-17 01:30:11 +09:00
</header>
<x-drive class="drive" ref="browser"
2018-02-22 07:06:47 +09:00
:select-file="true"
2018-02-17 01:30:11 +09:00
:multiple="multiple"
@change-selection="onChangeSelection"
@selected="onSelected"
/>
</div>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
import i18n from '../../../i18n';
2018-02-17 01:30:11 +09:00
export default Vue.extend({
i18n: i18n('mobile/views/components/drive-file-chooser.vue'),
components: {
XDrive: () => import('./drive.vue').then(m => m.default),
},
2018-02-17 01:30:11 +09:00
props: ['multiple'],
data() {
return {
files: []
};
},
methods: {
onChangeSelection(files) {
this.files = files;
},
onSelected(file) {
this.$emit('selected', file);
2018-09-15 21:53:04 +09:00
this.destroyDom();
2018-02-17 01:30:11 +09:00
},
cancel() {
this.$emit('canceled');
2018-09-15 21:53:04 +09:00
this.destroyDom();
2018-02-17 01:30:11 +09:00
},
ok() {
this.$emit('selected', this.files);
2018-09-15 21:53:04 +09:00
this.destroyDom();
2018-02-17 01:30:11 +09:00
}
}
});
</script>
<style lang="stylus" scoped>
2018-09-28 14:26:20 +09:00
.cdxzvcfawjxdyxsekbxbfgtplebnoneb
2018-02-17 01:30:11 +09:00
position fixed
2018-09-01 09:16:25 +09:00
z-index 20000
2018-02-17 01:30:11 +09:00
top 0
left 0
width 100%
height 100%
padding 8px
2018-04-29 08:51:17 +09:00
background rgba(#000, 0.2)
2018-02-17 01:30:11 +09:00
> .body
width 100%
height 100%
2018-09-28 14:26:20 +09:00
background var(--faceHeader)
2018-02-17 01:30:11 +09:00
> header
2018-09-28 14:26:20 +09:00
border-bottom solid 1px var(--faceDivider)
color var(--text)
2018-02-17 01:30:11 +09:00
> h1
margin 0
padding 0
text-align center
line-height 42px
font-size 1em
font-weight normal
> .count
margin-left 4px
opacity 0.5
> .close
position absolute
top 0
left 0
line-height 42px
width 42px
> .ok
position absolute
top 0
right 0
line-height 42px
width 42px
> .drive
2018-02-17 01:30:11 +09:00
height calc(100% - 42px)
overflow scroll
-webkit-overflow-scrolling touch
</style>