Add initial support for tracking current FM directory for creating a folder (and other stuff eventually)
This commit is contained in:
parent
767e466fd8
commit
be7f7d8da8
6 changed files with 80 additions and 6 deletions
|
@ -33,7 +33,7 @@
|
|||
</div>
|
||||
<div class="action">New File</div>
|
||||
</div>
|
||||
<div class="context-row">
|
||||
<div class="context-row" v-on:click="openFolderModal">
|
||||
<div class="icon">
|
||||
<Icon name="folder-plus" class="h-4"/>
|
||||
</div>
|
||||
|
@ -58,5 +58,12 @@
|
|||
export default Vue.extend({
|
||||
name: 'FileContextMenu',
|
||||
components: {Icon},
|
||||
|
||||
methods: {
|
||||
openFolderModal: function () {
|
||||
window.events.$emit('server:files:open-directory-modal');
|
||||
this.$emit('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -10,7 +10,12 @@
|
|||
<div class="flex-1 text-right text-neutral-600">{{formatDate(file.modified)}}</div>
|
||||
<div class="flex-none w-1/6"></div>
|
||||
</div>
|
||||
<FileContextMenu class="context-menu" v-show="contextMenuVisible" ref="contextMenu"/>
|
||||
<FileContextMenu
|
||||
class="context-menu"
|
||||
v-show="contextMenuVisible"
|
||||
v-on:close="contextMenuVisible = false"
|
||||
ref="contextMenu"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
<template>
|
||||
<Modal :show="visible" v-on:close="visible = false">
|
||||
<div>
|
||||
<h2 class="font-medium text-neutral-900 mb-6">{{ fm.currentDirectory }}</h2>
|
||||
</div>
|
||||
</Modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import Modal from '@/components/core/Modal.vue';
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default Vue.extend({
|
||||
name: 'CreateFolderModal',
|
||||
components: {Modal},
|
||||
|
||||
computed: {
|
||||
...mapState('server', ['fm']),
|
||||
},
|
||||
|
||||
data: function () {
|
||||
return {
|
||||
visible: false,
|
||||
};
|
||||
},
|
||||
|
||||
mounted: function () {
|
||||
window.events.$on('server:files:open-directory-modal', () => {
|
||||
this.visible = true;
|
||||
});
|
||||
},
|
||||
});
|
||||
</script>
|
Reference in a new issue