mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-29 19:25:57 +00:00
- fileinfodetail renamed to clipboard
This commit is contained in:
@@ -90,9 +90,9 @@ export default {
|
||||
CheckIcon,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['FilePreviewType', 'fileInfoDetail', 'data']),
|
||||
...mapGetters(['FilePreviewType', 'clipboard', 'data']),
|
||||
isClicked() {
|
||||
return this.fileInfoDetail.some(element => element.id === this.item.id)
|
||||
return this.clipboard.some(element => element.id === this.item.id)
|
||||
},
|
||||
isFolder() {
|
||||
return this.item.type === 'folder'
|
||||
@@ -152,8 +152,8 @@ export default {
|
||||
},
|
||||
showItemActions() {
|
||||
// Load file info detail
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.item)
|
||||
this.$store.commit('CLIPBOARD_CLEAR')
|
||||
this.$store.commit('ADD_ITEM_TO_CLIPBOARD', this.item)
|
||||
|
||||
events.$emit('mobile-menu:show', 'file-menu')
|
||||
},
|
||||
@@ -176,36 +176,36 @@ export default {
|
||||
if ((e.ctrlKey || e.metaKey) && !e.shiftKey) {
|
||||
// Click + Ctrl
|
||||
|
||||
if (this.fileInfoDetail.some(item => item.id === this.item.id)) {
|
||||
this.$store.commit('REMOVE_ITEM_FILEINFO_DETAIL', this.item)
|
||||
if (this.clipboard.some(item => item.id === this.item.id)) {
|
||||
this.$store.commit('REMOVE_ITEM_FROM_CLIPBOARD', this.item)
|
||||
} else {
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.item)
|
||||
this.$store.commit('ADD_ITEM_TO_CLIPBOARD', this.item)
|
||||
}
|
||||
} else if (e.shiftKey) {
|
||||
// Click + Shift
|
||||
let lastItem = this.data.indexOf(this.fileInfoDetail[this.fileInfoDetail.length - 1])
|
||||
let lastItem = this.data.indexOf(this.clipboard[this.clipboard.length - 1])
|
||||
let clickedItem = this.data.indexOf(this.item)
|
||||
|
||||
// If Click + Shift + Ctrl dont remove already selected items
|
||||
if (!e.ctrlKey && !e.metaKey) {
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
this.$store.commit('CLIPBOARD_CLEAR')
|
||||
}
|
||||
|
||||
//Shift selecting from top to bottom
|
||||
if (lastItem < clickedItem) {
|
||||
for (let i = lastItem; i <= clickedItem; i++) {
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.data[i])
|
||||
this.$store.commit('ADD_ITEM_TO_CLIPBOARD', this.data[i])
|
||||
}
|
||||
//Shift selecting from bottom to top
|
||||
} else {
|
||||
for (let i = lastItem; i >= clickedItem; i--) {
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.data[i])
|
||||
this.$store.commit('ADD_ITEM_TO_CLIPBOARD', this.data[i])
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Click
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.item)
|
||||
this.$store.commit('CLIPBOARD_CLEAR')
|
||||
this.$store.commit('ADD_ITEM_TO_CLIPBOARD', this.item)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,17 +221,20 @@ export default {
|
||||
} else {
|
||||
|
||||
if (this.isImage || this.isVideo || this.isAudio || this.isPdf) {
|
||||
this.$store.commit('LOAD_FILEINFO_DETAIL', this.item)
|
||||
|
||||
this.$store.commit('CLIPBOARD_CLEAR')
|
||||
this.$store.commit('ADD_ITEM_TO_CLIPBOARD', this.item)
|
||||
|
||||
events.$emit('file-preview:show')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.mobileMultiSelect && this.$isMobile()) {
|
||||
if (this.fileInfoDetail.some(item => item.id === this.item.id)) {
|
||||
this.$store.commit('REMOVE_ITEM_FILEINFO_DETAIL', this.item)
|
||||
if (this.clipboard.some(item => item.id === this.item.id)) {
|
||||
this.$store.commit('REMOVE_ITEM_FROM_CLIPBOARD', this.item)
|
||||
} else {
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.item)
|
||||
this.$store.commit('ADD_ITEM_TO_CLIPBOARD', this.item)
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -245,7 +248,7 @@ export default {
|
||||
} else if (this.isFolder) {
|
||||
|
||||
// Clear selected items after open another folder
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
this.$store.commit('CLIPBOARD_CLEAR')
|
||||
|
||||
if (this.$isThisLocation('public')) {
|
||||
this.$store.dispatch('browseShared', [{ folder: this.item, back: false, init: false }])
|
||||
@@ -279,12 +282,12 @@ export default {
|
||||
|
||||
events.$on('mobileSelecting:start', () => {
|
||||
this.mobileMultiSelect = true
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
this.$store.commit('CLIPBOARD_CLEAR')
|
||||
})
|
||||
|
||||
events.$on('mobileSelecting:stop', () => {
|
||||
this.mobileMultiSelect = false
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
this.$store.commit('CLIPBOARD_CLEAR')
|
||||
})
|
||||
|
||||
// Change item name
|
||||
|
||||
Reference in New Issue
Block a user