Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
lookacat committed Jun 21, 2022
1 parent 4be1391 commit d766c49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion packages/web-app-files/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export default defineComponent({
SideBar
},
mixins: [Mixins],
data: () => {
selectionCounter: 0;
},
computed: {
...mapState('Files/sidebar', {
sidebarClosed: 'closed',
Expand Down Expand Up @@ -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]
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion packages/web-app-files/src/store/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export default {
return id === file.id
})
if (fileIndex === -1) {
state.latestSelectedId = file.id
selected.push(file.id)
state.selectedIds = selected
}
Expand Down

0 comments on commit d766c49

Please sign in to comment.