refactor: remove shortcut hints in mobile devices

This commit is contained in:
liyasthomas
2021-12-20 14:40:38 +05:30
parent fac1288ef2
commit f94ee7c73f
23 changed files with 410 additions and 253 deletions

View File

@@ -8,7 +8,7 @@
@drop="dragging = false"
@dragleave="dragging = false"
@dragend="dragging = false"
@contextmenu.prevent="$refs.options.tippy().show()"
@contextmenu.prevent="options.tippy().show()"
>
<span
class="cursor-pointer flex px-4 items-center justify-center"
@@ -65,7 +65,7 @@
trigger="click"
theme="popover"
arrow
:on-shown="() => $refs.tippyActions.focus()"
:on-shown="() => tippyActions.focus()"
>
<template #trigger>
<ButtonSecondary
@@ -78,12 +78,13 @@
ref="tippyActions"
class="flex flex-col focus:outline-none"
tabindex="0"
@keyup.n="$refs.folder.$el.click()"
@keyup.e="$refs.edit.$el.click()"
@keyup.delete="$refs.delete.$el.click()"
@keyup.n="folderAction.$el.click()"
@keyup.e="edit.$el.click()"
@keyup.delete="deleteAction.$el.click()"
@keyup.escape="options.tippy().hide()"
>
<SmartItem
ref="folder"
ref="folderAction"
svg="folder-plus"
:label="$t('folder.new')"
:shortcut="['N']"
@@ -93,7 +94,7 @@
folder: collection,
path: `${collectionIndex}`,
})
$refs.options.tippy().hide()
options.tippy().hide()
}
"
/>
@@ -105,19 +106,19 @@
@click.native="
() => {
$emit('edit-collection')
$refs.options.tippy().hide()
options.tippy().hide()
}
"
/>
<SmartItem
ref="delete"
ref="deleteAction"
svg="trash-2"
:label="$t('action.delete')"
:shortcut="['⌫']"
@click.native="
() => {
confirmRemove = true
$refs.options.tippy().hide()
options.tippy().hide()
}
"
/>
@@ -182,7 +183,7 @@
:src="`/images/states/${$colorMode.value}/pack.svg`"
loading="lazy"
class="flex-col object-contain object-center h-16 mb-4 w-16 inline-flex"
:alt="$t('empty.collection')"
:alt="`${$t('empty.collection')}`"
/>
<span class="text-center">
{{ $t("empty.collection") }}
@@ -199,8 +200,8 @@
</div>
</template>
<script>
import { defineComponent } from "@nuxtjs/composition-api"
<script lang="ts">
import { defineComponent, ref } from "@nuxtjs/composition-api"
import { moveRESTRequest } from "~/newstore/collections"
export default defineComponent({
@@ -214,6 +215,15 @@ export default defineComponent({
collectionsType: { type: Object, default: () => {} },
picked: { type: Object, default: () => {} },
},
setup() {
return {
tippyActions: ref<any | null>(null),
options: ref<any | null>(null),
folderAction: ref<any | null>(null),
edit: ref<any | null>(null),
deleteAction: ref<any | null>(null),
}
},
data() {
return {
showChildren: false,
@@ -226,7 +236,7 @@ export default defineComponent({
}
},
computed: {
isSelected() {
isSelected(): boolean {
return (
this.picked &&
this.picked.pickedType === "my-collection" &&