From 626eb622f89cb94668658fce74925f361309e843 Mon Sep 17 00:00:00 2001 From: pipipi-pikachu <1171051090@qq.com> Date: Sat, 26 Dec 2020 09:48:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=B1=80=E5=BF=AB=E6=8D=B7=E9=94=AE?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Editor/useHotkey.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/views/Editor/useHotkey.ts b/src/views/Editor/useHotkey.ts index dcb73f5b..f74703dd 100644 --- a/src/views/Editor/useHotkey.ts +++ b/src/views/Editor/useHotkey.ts @@ -42,14 +42,14 @@ export default () => { const copy = () => { if(disableHotkeys.value) return - if(thumbnailsFocus.value) copySlide() - else if(activeElementIdList.value.length) copyElement() + if(activeElementIdList.value.length) copyElement() + else if(thumbnailsFocus.value) copySlide() } const cut = () => { if(disableHotkeys.value) return - if(thumbnailsFocus.value) cutSlide() - else if(activeElementIdList.value.length) cutElement() + if(activeElementIdList.value.length) cutElement() + else if(thumbnailsFocus.value) cutSlide() } const selectAll = () => { @@ -73,16 +73,14 @@ export default () => { const remove = () => { if(disableHotkeys.value) return - if(thumbnailsFocus.value) deleteSlide() - else if(activeElementIdList.value.length) deleteElement() + if(activeElementIdList.value.length) deleteElement() + else if(thumbnailsFocus.value) deleteSlide() } const move = (key: string) => { if(disableHotkeys.value) return - if(thumbnailsFocus.value && (key === KEYS.UP || key === KEYS.DOWN)) { - updateSlideIndex(key) - } - else if(activeElementIdList.value.length) moveElement(key) + if(activeElementIdList.value.length) moveElement(key) + else if(key === KEYS.UP || key === KEYS.DOWN) updateSlideIndex(key) } const create = () => {