mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-27 18:40:39 +00:00
backspace fix
This commit is contained in:
@@ -38,7 +38,7 @@ export default {
|
|||||||
ItemHandler,
|
ItemHandler,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['isVisibleSidebar', 'currentFolder', 'itemViewType', 'clipboard', 'entries', 'config', 'currentTeamFolder', 'user']),
|
...mapGetters(['isVisibleSidebar', 'currentFolder', 'itemViewType', 'clipboard', 'entries', 'config']),
|
||||||
draggedItems() {
|
draggedItems() {
|
||||||
// Set opacity for dragged items
|
// Set opacity for dragged items
|
||||||
if (!this.clipboard.includes(this.draggingId)) {
|
if (!this.clipboard.includes(this.draggingId)) {
|
||||||
@@ -58,27 +58,10 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
deleteItems() {
|
deleteItems() {
|
||||||
// Prevent delete in SharedWithMe and TeamFolders homepage
|
|
||||||
if ((this.$isThisRoute(['SharedWithMe', 'TeamFolders']) && !this.$route.params.id)) return
|
|
||||||
|
|
||||||
// Prevent delete in SharedWithMe with visit privileges
|
|
||||||
if ((this.$isThisRoute(['SharedWithMe']) && ! this.canEdit())) return
|
|
||||||
|
|
||||||
if ((this.clipboard.length > 0 && this.$checkPermission('master')) || this.$checkPermission('editor')) {
|
if ((this.clipboard.length > 0 && this.$checkPermission('master')) || this.$checkPermission('editor')) {
|
||||||
this.$store.dispatch('deleteItem')
|
this.$store.dispatch('deleteItem')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
canEdit() {
|
|
||||||
if (this.currentTeamFolder && this.user) {
|
|
||||||
let member = this.currentTeamFolder.data.relationships.members.data.find(
|
|
||||||
(member) => member.data.id === this.user.data.id
|
|
||||||
)
|
|
||||||
|
|
||||||
return member.data.attributes.permission === 'can-edit'
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
},
|
|
||||||
uploadDroppedItems(event) {
|
uploadDroppedItems(event) {
|
||||||
this.$uploadDraggedFiles(event, this.currentFolder.data.id)
|
this.$uploadDraggedFiles(event, this.currentFolder.data.id)
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class FakeRenameFileOrFolderAction
|
|||||||
public function __invoke(
|
public function __invoke(
|
||||||
RenameItemRequest $request,
|
RenameItemRequest $request,
|
||||||
string $id,
|
string $id,
|
||||||
): array|File {
|
): array {
|
||||||
// Get item
|
// Get item
|
||||||
if ($request->input('type') === 'folder') {
|
if ($request->input('type') === 'folder') {
|
||||||
$item = Folder::where('id', $id)
|
$item = Folder::where('id', $id)
|
||||||
|
|||||||
Reference in New Issue
Block a user