api resource refactoring part 5

This commit is contained in:
Peter Papp
2021-08-27 13:02:28 +02:00
parent 7984ce3ef1
commit 4304fb1ddb
14 changed files with 123 additions and 75 deletions
@@ -57,15 +57,6 @@ export default {
// Reset item container
this.item = undefined
},
showFolderActionsMenu() {
let container = document.getElementById('folder-actions')
this.positionX = container.offsetLeft + 16
this.positionY = container.offsetTop + 30
// Show context menu
this.isVisible = true
},
showContextMenu(event) {
let parent = document.getElementById('menu-list')
let nodesSameClass = parent.getElementsByClassName('menu-option')
@@ -107,14 +98,16 @@ export default {
setTimeout(() => this.showContextMenu(event, item), 10)
})
events.$on('folder:actions', (folder) => {
// Store item
events.$on('context-menu:current-folder', folder => {
this.item = folder
this.isVisible = ! this.isVisible
if (this.isVisible) {
this.isVisible = false
} else {
this.showFolderActionsMenu()
let container = document.getElementById('folder-actions')
this.positionX = container.offsetLeft + 16
this.positionY = container.offsetTop + 30
}
})
@@ -8,7 +8,7 @@
{{ directoryName }}
</span>
<span v-if="isLoadedFolder" @click.stop="folderActions" class="location-more group" id="folder-actions">
<span v-show="isLoadedFolder" @click.stop="folderActions" class="location-more group" id="folder-actions">
<more-horizontal-icon size="14" class="icon-more group-hover-text-theme" />
</span>
</div>
@@ -228,8 +228,7 @@
events.$emit('popover:open', 'desktop-sorting')
},
folderActions() {
// todo: add current folder
events.$emit('folder:actions', this.currentFolder)
events.$emit('context-menu:current-folder', this.currentFolder)
},
},
}
@@ -57,7 +57,7 @@
:title="$t('file_detail.where')"
>
<div class="action-button" @click="openMoveOptions">
<span>{{ singleFile.parent ? singleFile.parent.name : $t('locations.home') }}</span>
<span>{{ singleFile.data.relationships.parent ? singleFile.data.relationships.parent.data.attributes.name : $t('locations.home') }}</span>
<edit-2-icon size="10" class="edit-icon" />
</div>
</ListInfoItem>