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

106 lines
1.8 KiB
Vue
Raw Normal View History

2018-02-16 18:30:11 +02:00
<template>
<div class="cdxzvcfawjxdyxsekbxbfgtplebnoneb">
2018-02-16 18:30:11 +02:00
<div class="body">
<header>
2018-04-14 19:04:40 +03:00
<h1>%i18n:@select-file%<span class="count" v-if="files.length > 0">({{ files.length }})</span></h1>
2018-02-16 18:30:11 +02:00
<button class="close" @click="cancel">%fa:times%</button>
2018-02-22 00:06:47 +02:00
<button v-if="multiple" class="ok" @click="ok">%fa:check%</button>
2018-02-16 18:30:11 +02:00
</header>
<mk-drive class="drive" ref="browser"
2018-02-22 00:06:47 +02:00
:select-file="true"
2018-02-16 18:30:11 +02:00
:multiple="multiple"
@change-selection="onChangeSelection"
@selected="onSelected"
/>
</div>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
props: ['multiple'],
data() {
return {
files: []
};
},
methods: {
onChangeSelection(files) {
this.files = files;
},
onSelected(file) {
this.$emit('selected', file);
this.$destroy();
},
cancel() {
this.$emit('canceled');
this.$destroy();
},
ok() {
this.$emit('selected', this.files);
this.$destroy();
}
}
});
</script>
<style lang="stylus" scoped>
root(isDark)
2018-02-16 18:30:11 +02:00
position fixed
2018-09-01 03:16:25 +03:00
z-index 20000
2018-02-16 18:30:11 +02:00
top 0
left 0
width 100%
height 100%
padding 8px
2018-04-29 02:51:17 +03:00
background rgba(#000, 0.2)
2018-02-16 18:30:11 +02:00
> .body
width 100%
height 100%
background isDark ? #282c37 : #fff
2018-02-16 18:30:11 +02:00
> header
border-bottom solid 1px isDark ? #1b1f29 : #eee
color isDark ? #fff : #111
2018-02-16 18:30:11 +02: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-16 18:30:11 +02:00
height calc(100% - 42px)
overflow scroll
-webkit-overflow-scrolling touch
.cdxzvcfawjxdyxsekbxbfgtplebnoneb[data-darkmode]
root(true)
.cdxzvcfawjxdyxsekbxbfgtplebnoneb:not([data-darkmode])
root(false)
2018-02-16 18:30:11 +02:00
</style>