solved issuis from Bulk Review v3,v4

This commit is contained in:
Milos Holba
2020-12-19 15:12:56 +01:00
parent 55cf58fffd
commit 65624326c7
17 changed files with 195 additions and 111 deletions

View File

@@ -574,7 +574,7 @@ export default {
setTimeout(() => this.showContextMenu(event, item), 10)
})
events.$on('contextMenu:hide', () => this.closeAndResetContextMenu())
events.$on('unClick', () => this.closeAndResetContextMenu())
events.$on('folder:actions', (folder) => {
// Store item

View File

@@ -6,7 +6,6 @@
<script>
import SortingAndPreviewMenu from '@/components/FilesView/SortingAndPreviewMenu'
import { mapGetters } from 'vuex'
import { events } from '@/bus'
export default {
@@ -21,6 +20,10 @@ import { events } from '@/bus'
events.$on('sortingAndPreview', (state) => {
this.isVisible = state
})
events.$on('unClick', () => {
this.isVisible = false
})
}
}
</script>

View File

@@ -149,7 +149,7 @@ export default {
}
if (!this.sortingAndPreview) {
events.$emit('sortingAndPreview', false)
events.$emit('unClick')
}
}
},
@@ -186,7 +186,8 @@ export default {
this.$createFolder()
},
moveItem() {
events.$emit('popup:open', { name: 'move', item: this.fileInfoDetail })
if(this.fileInfoDetail.length > 0)
events.$emit('popup:open', { name: 'move', item: this.fileInfoDetail })
},
shareItem() {
if (this.fileInfoDetail[0]) {
@@ -206,9 +207,13 @@ export default {
}
},
mounted() {
events.$on('sortingAndPreview', (state) => {
this.sortingAndPreview = state
})
// events.$on('sortingAndPreview', (state) => {
// this.sortingAndPreview = state
// })
events.$on('unClick', () => {
this.sortingAndPreview = false
})
}
}
</script>

View File

@@ -222,11 +222,9 @@
events.$emit('contextMenu:show', event, item)
},
filesContainerClick() {
// Deselect itms clicked by outside
this.$store.commit('CLEAR_FILEINFO_DETAIL')
// Hide context menu if is opened
events.$emit('contextMenu:hide')
}
},
created() {

View File

@@ -32,7 +32,7 @@
<!--Name-->
<div class="item-name">
<!--Name-->
<b ref="name" @input="renameItem" :contenteditable="canEditName" class="name">
<b ref="name" @input="renameItem" @keydown.delete.stop :contenteditable="canEditName" class="name">
{{ itemName }}
</b>
@@ -155,9 +155,7 @@ export default {
this.area = false
},
clickedItem(e) {
events.$emit('contextMenu:hide')
events.$emit('sortingAndPreview', false)
events.$emit('unClick')
if (!this.$isMobile()) {
if (e.ctrlKey || e.metaKey && !e.shiftKey) {

View File

@@ -42,7 +42,7 @@
<!--Name-->
<div class="item-name">
<!--Name-->
<b ref="name" @input="renameItem" :contenteditable="canEditName" class="name">
<b ref="name" @input="renameItem" @keydown.delete.stop :contenteditable="canEditName" class="name">
{{ itemName }}
</b>
@@ -166,9 +166,7 @@ export default {
this.area = false
},
clickedItem(e) {
events.$emit('contextMenu:hide')
events.$emit('sortingAndPreview', false)
events.$emit('unClick')
if(!this.$isMobile()) {

View File

@@ -1,12 +1,14 @@
<template>
<transition name="context-menu">
<div class="multiselect-actions" v-if="mobileMultiSelect">
<ToolbarButton class="action-btn" v-if="!$isThisLocation(['trash', 'trash-root']) && $checkPermission('master') || $checkPermission('editor')" source="move" :action="$t('actions.move')" :class="{'is-inactive' : fileInfoDetail.length < 1}" @click.native="moveItem"/>
<ToolbarButton class="action-btn" v-if="!$isThisLocation(['trash', 'trash-root' , 'shared', 'latest']) && $checkPermission('master') || $checkPermission('editor')" source="move" :action="$t('actions.move')" :class="{'is-inactive' : fileInfoDetail.length < 1}" @click.native="moveItem"/>
<ToolbarButton class="action-btn" v-if="$checkPermission('master') || $checkPermission('editor')" source="trash" :class="{'is-inactive' : fileInfoDetail.length < 1}" :action="$t('actions.delete')" @click.native="deleteItem"/>
<ToolbarButton class="action-btn" v-if="!$isThisLocation(['shared']) && $checkPermission('master') || $checkPermission('editor')" source="trash" :class="{'is-inactive' : fileInfoDetail.length < 1}" :action="$t('actions.delete')" @click.native="deleteItem"/>
<ToolbarButton class="action-btn" source="download" :class="{'is-inactive': canDownloadItems}" :action="$t('actions.delete')" @click.native="downloadItem"/>
<ToolbarButton class="action-btn" v-if="!$isThisLocation(['shared'])" source="download" :class="{'is-inactive': canDownloadItems}" :action="$t('actions.delete')" @click.native="downloadItem"/>
<ToolbarButton class="action-btn" source="shared-off" @click.native="shareCancel" v-if="$isThisLocation(['shared'])"/>
<ToolbarButton class="action-btn close-icon" source="close" :action="$t('actions.close')" @click.native="closeSelecting"/>
</div>
</transition>
@@ -32,6 +34,10 @@ export default {
}
},
methods: {
shareCancel() {
this.$store.dispatch('shareCancel')
this.closeSelecting()
},
closeSelecting() {
events.$emit('mobileSelecting:stop')
},
@@ -41,14 +47,17 @@ export default {
else {
this.$downloadFile(this.fileInfoDetail[0].file_url, this.fileInfoDetail[0].name + '.' + this.fileInfoDetail[0].mimetype)
}
this.closeSelecting()
},
moveItem() {
// Open move item popup
events.$emit('popup:open', { name: 'move', item: [this.fileInfoDetail[0]] })
this.closeSelecting()
},
deleteItem() {
//Delete items
this.$store.dispatch('deleteItem')
this.closeSelecting()
}
},
created() {

View File

@@ -6,7 +6,6 @@
<script>
import SortingAndPreviewMenu from '@/components/FilesView/SortingAndPreviewMenu'
import { mapGetters } from 'vuex'
import { events } from '@/bus'
export default {

View File

@@ -20,6 +20,7 @@
<grid-icon v-if="source === 'th'" size="19"></grid-icon>
<link-icon v-if="source === 'share'" size="19"></link-icon>
<x-icon v-if="source === 'close'" size="19"></x-icon>
<cloud-off-icon v-if="source === 'shared-off'" size="19"></cloud-off-icon>
<svg v-if="source === 'preview-sorting'" size="19"
width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -55,6 +56,7 @@ import {
DownloadCloudIcon,
XIcon,
PrinterIcon,
CloudOffIcon,
} from "vue-feather-icons";
export default {
@@ -64,6 +66,7 @@ export default {
CornerDownRightIcon,
DownloadCloudIcon,
FolderPlusIcon,
CloudOffIcon,
PrinterIcon,
Trash2Icon,
Edit2Icon,