From 339aad2d6efe64dfd0efb65d038a8713df332fef Mon Sep 17 00:00:00 2001 From: joshuaboud Date: Mon, 30 May 2022 17:22:02 -0300 Subject: [PATCH] implement clipboard --- navigator/src/App.vue | 7 +- navigator/src/components/DirectoryEntry.vue | 8 +- .../src/components/DirectoryEntryList.vue | 5 +- navigator/src/components/DirectoryView.vue | 139 ++++++++---------- navigator/src/functions/getDirEntryObjects.js | 3 + navigator/src/keys.js | 4 + navigator/src/main.js | 3 +- navigator/src/views/Browser.vue | 2 - 8 files changed, 87 insertions(+), 84 deletions(-) diff --git a/navigator/src/App.vue b/navigator/src/App.vue index e8fd554..7ae9069 100644 --- a/navigator/src/App.vue +++ b/navigator/src/App.vue @@ -15,7 +15,7 @@ import { ref, reactive, provide, onBeforeMount } from "vue"; import SettingsMenu from "./components/SettingsMenu.vue"; import Notifications from './components/Notifications.vue'; import { FIFO } from '@45drives/cockpit-helpers'; -import { settingsInjectionKey, notificationsInjectionKey, pathHistoryInjectionKey } from "./keys"; +import { settingsInjectionKey, notificationsInjectionKey, pathHistoryInjectionKey, clipboardInjectionKey } from "./keys"; const props = defineProps({ notificationFIFO: FIFO }); @@ -48,6 +48,11 @@ const pathHistory = reactive({ forwardAllowed: () => pathHistory.index < pathHistory.stack.length - 1, }); provide(pathHistoryInjectionKey, pathHistory); + +const clipboard = reactive({ + content: [], +}); +provide(clipboardInjectionKey, clipboard); providesValid.value = true; const routerViewFooterText = ref(""); diff --git a/navigator/src/components/DirectoryEntry.vue b/navigator/src/components/DirectoryEntry.vue index 75d51ba..1a36c55 100644 --- a/navigator/src/components/DirectoryEntry.vue +++ b/navigator/src/components/DirectoryEntry.vue @@ -3,11 +3,11 @@ -
+
@@ -79,7 +79,7 @@ v-else v-show="show" @dblclick.stop="doubleClickCallback" - @click.stop.prevent="$emit('toggleSelected', { ctrlKey: $event.ctrlKey, shiftKey: $event.shiftKey })" + @click.prevent.stop="$emit('toggleSelected', { ctrlKey: $event.ctrlKey, shiftKey: $event.shiftKey })" >
@@ -150,7 +150,7 @@ export default { }) } - const getSelected = () => directoryViewRef.value?.getSelected?.() ?? []; + const getSelected = () => directoryViewRef.value.getSelected() ?? []; const selectAll = () => { directoryViewRef.value?.selection.selectAll(); diff --git a/navigator/src/components/DirectoryEntryList.vue b/navigator/src/components/DirectoryEntryList.vue index d46c43f..73aee6a 100644 --- a/navigator/src/components/DirectoryEntryList.vue +++ b/navigator/src/components/DirectoryEntryList.vue @@ -21,7 +21,7 @@