mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-30 07:44:41 +00:00
- fileinfodetail renamed to clipboard
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div v-if="canBePreview" class="preview">
|
||||
<img v-if="fileInfoDetail[0].type == 'image' && fileInfoDetail[0].thumbnail" :src="fileInfoDetail[0].thumbnail" :alt="fileInfoDetail[0].name" />
|
||||
<audio v-else-if="fileInfoDetail[0].type == 'audio'" :src="fileInfoDetail[0].file_url" controlsList="nodownload" controls></audio>
|
||||
<video v-else-if="fileInfoDetail[0].type == 'video'" controlsList="nodownload" disablePictureInPicture playsinline controls>
|
||||
<source :src="fileInfoDetail[0].file_url" type="video/mp4">
|
||||
<img v-if="clipboard[0].type == 'image' && clipboard[0].thumbnail" :src="clipboard[0].thumbnail" :alt="clipboard[0].name" />
|
||||
<audio v-else-if="clipboard[0].type == 'audio'" :src="clipboard[0].file_url" controlsList="nodownload" controls></audio>
|
||||
<video v-else-if="clipboard[0].type == 'video'" controlsList="nodownload" disablePictureInPicture playsinline controls>
|
||||
<source :src="clipboard[0].file_url" type="video/mp4">
|
||||
</video>
|
||||
</div>
|
||||
</template>
|
||||
@@ -15,11 +15,11 @@
|
||||
export default {
|
||||
name: 'FilePreview',
|
||||
computed: {
|
||||
...mapGetters(['fileInfoDetail']),
|
||||
...mapGetters(['clipboard']),
|
||||
canBePreview() {
|
||||
return this.fileInfoDetail[0] && ! includes([
|
||||
return this.clipboard[0] && ! includes([
|
||||
'folder', 'file'
|
||||
], this.fileInfoDetail[0].type)
|
||||
], this.clipboard[0].type)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
|
||||
<!--Folder tree-->
|
||||
<div v-if="! isLoadingTree && navigation">
|
||||
<ThumbnailItem v-if="fileInfoDetail.length < 2 || isSelectedItem" class="item-thumbnail" :item="pickedItem" info="location" />
|
||||
<ThumbnailItem v-if="clipboard.length < 2 || isSelectedItem" class="item-thumbnail" :item="pickedItem" info="location" />
|
||||
|
||||
<MultiSelected class="multiple-selected"
|
||||
:title="$t('file_detail.selected_multiple')"
|
||||
:subtitle="this.fileInfoDetail.length + ' ' + $tc('file_detail.items', this.fileInfoDetail.length)"
|
||||
v-if="fileInfoDetail.length > 1 && !isSelectedItem" />
|
||||
:subtitle="this.clipboard.length + ' ' + $tc('file_detail.items', this.clipboard.length)"
|
||||
v-if="clipboard.length > 1 && !isSelectedItem" />
|
||||
|
||||
<TreeMenu :disabled-by-id="pickedItem" :depth="1" :nodes="items" v-for="items in navigation" :key="items.id" />
|
||||
</div>
|
||||
@@ -69,7 +69,7 @@
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'fileInfoDetail',
|
||||
'clipboard',
|
||||
'navigation',
|
||||
]),
|
||||
},
|
||||
@@ -87,7 +87,7 @@
|
||||
if (!this.selectedFolder) return
|
||||
|
||||
// Prevent to move items to the same parent
|
||||
if ( isArray(this.selectedFolder) && this.fileInfoDetail.find(item => item.parent_id === this.selectedFolder.id)) return
|
||||
if ( isArray(this.selectedFolder) && this.clipboard.find(item => item.parent_id === this.selectedFolder.id)) return
|
||||
|
||||
// Move item
|
||||
if (!this.isSelectedItem) {
|
||||
@@ -134,13 +134,13 @@
|
||||
})
|
||||
|
||||
// Store picked item
|
||||
if (!this.fileInfoDetail.includes(args.item[0])) {
|
||||
if (!this.clipboard.includes(args.item[0])) {
|
||||
this.pickedItem = args.item[0]
|
||||
this.isSelectedItem = true
|
||||
}
|
||||
|
||||
if (this.fileInfoDetail.includes(args.item[0])) {
|
||||
this.pickedItem = this.fileInfoDetail[0]
|
||||
if (this.clipboard.includes(args.item[0])) {
|
||||
this.pickedItem = this.clipboard[0]
|
||||
this.isSelectedItem = false
|
||||
}
|
||||
})
|
||||
|
||||
@@ -31,14 +31,14 @@
|
||||
TreeMenu,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['fileInfoDetail']),
|
||||
...mapGetters(['clipboard']),
|
||||
indent() {
|
||||
return { paddingLeft: this.depth * 20 + 'px' }
|
||||
},
|
||||
disableId() {
|
||||
let canBeShow = true
|
||||
if(this.fileInfoDetail.includes(this.disabledById)){
|
||||
this.fileInfoDetail.map(item => {
|
||||
if(this.clipboard.includes(this.disabledById)){
|
||||
this.clipboard.map(item => {
|
||||
if(item.id === this.nodes.id) {
|
||||
canBeShow = false
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
FolderIcon,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['fileInfoDetail']),
|
||||
...mapGetters(['clipboard']),
|
||||
|
||||
disabledFolder() {
|
||||
let disableFolder = false
|
||||
@@ -84,12 +84,12 @@
|
||||
methods: {
|
||||
dragFinish() {
|
||||
// Move no selected item
|
||||
if(!this.fileInfoDetail.includes(this.draggedItem[0])) {
|
||||
if(!this.clipboard.includes(this.draggedItem[0])) {
|
||||
this.$store.dispatch('moveItem', {to_item: this.nodes ,noSelectedItem:this.draggedItem[0]})
|
||||
}
|
||||
|
||||
// Move all selected items
|
||||
if(this.fileInfoDetail.includes(this.draggedItem[0])) {
|
||||
if(this.clipboard.includes(this.draggedItem[0])) {
|
||||
this.$store.dispatch('moveItem', {to_item: this.nodes ,noSelectedItem:null})
|
||||
}
|
||||
|
||||
@@ -127,12 +127,12 @@
|
||||
//Get dragged item
|
||||
events.$on('dragstart' , (data) => {
|
||||
//If is dragged item not selected
|
||||
if(!this.fileInfoDetail.includes(data)) {
|
||||
if(!this.clipboard.includes(data)) {
|
||||
this.draggedItem = [data]
|
||||
}
|
||||
//If are the dragged items selected
|
||||
if(this.fileInfoDetail.includes(data)) {
|
||||
this.draggedItem = this.fileInfoDetail
|
||||
if(this.clipboard.includes(data)) {
|
||||
this.draggedItem = this.clipboard
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user