Merge branch 'develop' of https://github.com/syuilo/misskey into develop

This commit is contained in:
syuilo 2019-07-04 14:45:33 +09:00
commit 2e1a9dffbe
6 changed files with 18 additions and 1 deletions

View file

@ -91,6 +91,7 @@ export default ($root: any) => {
? Promise.resolve(file) ? Promise.resolve(file)
: $root.$chooseDriveFile({ : $root.$chooseDriveFile({
multiple: false, multiple: false,
type: 'image/*',
title: locale['desktop']['choose-avatar'] title: locale['desktop']['choose-avatar']
}); });

View file

@ -91,6 +91,7 @@ export default ($root: any) => {
? Promise.resolve(file) ? Promise.resolve(file)
: $root.$chooseDriveFile({ : $root.$chooseDriveFile({
multiple: false, multiple: false,
type: 'image/*',
title: locale['desktop']['choose-banner'] title: locale['desktop']['choose-banner']
}); });

View file

@ -77,6 +77,7 @@ init(async (launch, os) => {
if (document.body.clientWidth > 800) { if (document.body.clientWidth > 800) {
const w = this.$root.new(MkChooseFileFromDriveWindow, { const w = this.$root.new(MkChooseFileFromDriveWindow, {
title: o.title, title: o.title,
type: o.type,
multiple: o.multiple, multiple: o.multiple,
initFolder: o.currentFolder initFolder: o.currentFolder
}); });

View file

@ -11,6 +11,7 @@
<x-drive <x-drive
ref="browser" ref="browser"
class="browser" class="browser"
:type="type"
:multiple="multiple" :multiple="multiple"
@selected="onSelected" @selected="onSelected"
@change-selection="onChangeSelection" @change-selection="onChangeSelection"
@ -33,6 +34,11 @@ export default Vue.extend({
XDrive: () => import('./drive.vue').then(m => m.default), XDrive: () => import('./drive.vue').then(m => m.default),
}, },
props: { props: {
type: {
type: String,
required: false,
default: undefined
},
multiple: { multiple: {
default: false default: false
} }

View file

@ -80,6 +80,11 @@ export default Vue.extend({
type: Object, type: Object,
required: false required: false
}, },
type: {
type: String,
required: false,
default: undefined
},
multiple: { multiple: {
type: Boolean, type: Boolean,
default: false default: false
@ -540,6 +545,7 @@ export default Vue.extend({
// //
this.$root.api('drive/files', { this.$root.api('drive/files', {
folderId: this.folder ? this.folder.id : null, folderId: this.folder ? this.folder.id : null,
type: this.type,
limit: filesMax + 1 limit: filesMax + 1
}).then(files => { }).then(files => {
if (files.length == filesMax + 1) { if (files.length == filesMax + 1) {
@ -570,6 +576,7 @@ export default Vue.extend({
// //
this.$root.api('drive/files', { this.$root.api('drive/files', {
folderId: this.folder ? this.folder.id : null, folderId: this.folder ? this.folder.id : null,
type: this.type,
untilId: this.files[this.files.length - 1].id, untilId: this.files[this.files.length - 1].id,
limit: max + 1 limit: max + 1
}).then(files => { }).then(files => {

View file

@ -8,6 +8,7 @@
</header> </header>
<x-drive class="drive" ref="browser" <x-drive class="drive" ref="browser"
:select-file="true" :select-file="true"
:type="type"
:multiple="multiple" :multiple="multiple"
@change-selection="onChangeSelection" @change-selection="onChangeSelection"
@selected="onSelected" @selected="onSelected"
@ -25,7 +26,7 @@ export default Vue.extend({
components: { components: {
XDrive: () => import('./drive.vue').then(m => m.default), XDrive: () => import('./drive.vue').then(m => m.default),
}, },
props: ['multiple'], props: ['type', 'multiple'],
data() { data() {
return { return {
files: [] files: []