From d766c4950b24e59dfbed1a65dd03e8073d3b59c7 Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Tue, 21 Jun 2022 10:59:09 +0200 Subject: [PATCH] WIP --- packages/web-app-files/src/App.vue | 8 +++++++- packages/web-app-files/src/store/mutations.js | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/web-app-files/src/App.vue b/packages/web-app-files/src/App.vue index 4c99e2a67f1..57d16bd449b 100644 --- a/packages/web-app-files/src/App.vue +++ b/packages/web-app-files/src/App.vue @@ -29,6 +29,9 @@ export default defineComponent({ SideBar }, mixins: [Mixins], + data: () => { + selectionCounter: 0; + }, computed: { ...mapState('Files/sidebar', { sidebarClosed: 'closed', @@ -87,13 +90,15 @@ export default defineComponent({ const isUpPressed = key === 38 const isDownPressed = key === 40 if(isDownPressed) { + const latestSelectedRow = document.querySelectorAll(`[data-item-id='${this.latestSelectedId}']`)[0] - const nextRow = latestSelectedRow.nextSibling as HTMLElement + let nextRow = latestSelectedRow.nextSibling as HTMLElement const nextResourceId = nextRow.getAttribute("data-item-id") console.log(nextRow) console.log(nextResourceId) this.toggleFileSelection({id: nextResourceId}) + this.selectionCounter += 1 } if(isUpPressed) { const latestSelectedRow = document.querySelectorAll(`[data-item-id='${this.latestSelectedId}']`)[0] @@ -103,6 +108,7 @@ export default defineComponent({ console.log(nextRow) console.log(nextResourceId) this.toggleFileSelection({id: nextResourceId}) + this.selectionCounter -= 1 } // get last selected id // find index in dom diff --git a/packages/web-app-files/src/store/mutations.js b/packages/web-app-files/src/store/mutations.js index e281c0aeb52..334fd7353a7 100644 --- a/packages/web-app-files/src/store/mutations.js +++ b/packages/web-app-files/src/store/mutations.js @@ -107,7 +107,6 @@ export default { return id === file.id }) if (fileIndex === -1) { - state.latestSelectedId = file.id selected.push(file.id) state.selectedIds = selected }