From c6447b5676439ffdb78fe3e0fd17e749883c815e Mon Sep 17 00:00:00 2001 From: geoffreychen777 Date: Fri, 25 Mar 2022 23:12:08 +0000 Subject: [PATCH] fix quicklook bugs. --- src/pages/entities_view/EntitiesView.vue | 14 ++++++++++++++ src/pages/toolbar_view/ToolbarView.vue | 6 ------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/pages/entities_view/EntitiesView.vue b/src/pages/entities_view/EntitiesView.vue index 9f974845..f2ffb269 100644 --- a/src/pages/entities_view/EntitiesView.vue +++ b/src/pages/entities_view/EntitiesView.vue @@ -33,6 +33,20 @@ export default defineComponent({ viewType.value = JSON.parse(message as string) as string; }); + function preventSpaceScrollEvent (event: KeyboardEvent) { + console.log(event) + if (event.code === 'Space') { + if (event.target instanceof HTMLInputElement) { + return true; + } + event.preventDefault() + if (props.selectedEntities?.length == 1) { + void window.entityInteractor.preview(props.selectedEntities[0].mainURL) + } + } + } + window.addEventListener('keydown', preventSpaceScrollEvent, true) + return { viewType, ...toRefs(props), diff --git a/src/pages/toolbar_view/ToolbarView.vue b/src/pages/toolbar_view/ToolbarView.vue index d192916e..3e25cb6f 100644 --- a/src/pages/toolbar_view/ToolbarView.vue +++ b/src/pages/toolbar_view/ToolbarView.vue @@ -218,12 +218,6 @@ Examples:
window.systemInteractor.setState('viewState.viewType', JSON.stringify(viewType)); }; - window.systemInteractor.registerSignal('shortcutClicked-Space', () => { - if (props.selectedEntities.length == 1) { - void window.entityInteractor.preview(props.selectedEntities[0].mainURL) - } - }); - window.systemInteractor.registerSignal('shortcutClicked-Enter', () => { if (props.selectedEntities.length == 1) { void window.entityInteractor.open(props.selectedEntities[0].mainURL);