mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-27 18:40:39 +00:00
api resource refactoring part 5
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user