refactor: remove shortcut hints in mobile devices
This commit is contained in:
@@ -30,8 +30,10 @@
|
||||
: 'radio_button_unchecked'
|
||||
"
|
||||
@click.native="
|
||||
authType = 'none'
|
||||
$refs.authTypeOptions.tippy().hide()
|
||||
() => {
|
||||
authType = 'none'
|
||||
authTypeOptions.tippy().hide()
|
||||
}
|
||||
"
|
||||
/>
|
||||
<SmartItem
|
||||
@@ -42,8 +44,10 @@
|
||||
: 'radio_button_unchecked'
|
||||
"
|
||||
@click.native="
|
||||
authType = 'basic'
|
||||
$refs.authTypeOptions.tippy().hide()
|
||||
() => {
|
||||
authType = 'basic'
|
||||
authTypeOptions.tippy().hide()
|
||||
}
|
||||
"
|
||||
/>
|
||||
<SmartItem
|
||||
@@ -54,8 +58,10 @@
|
||||
: 'radio_button_unchecked'
|
||||
"
|
||||
@click.native="
|
||||
authType = 'bearer'
|
||||
$refs.authTypeOptions.tippy().hide()
|
||||
() => {
|
||||
authType = 'bearer'
|
||||
authTypeOptions.tippy().hide()
|
||||
}
|
||||
"
|
||||
/>
|
||||
<SmartItem
|
||||
@@ -66,8 +72,10 @@
|
||||
: 'radio_button_unchecked'
|
||||
"
|
||||
@click.native="
|
||||
authType = 'oauth-2'
|
||||
$refs.authTypeOptions.tippy().hide()
|
||||
() => {
|
||||
authType = 'oauth-2'
|
||||
authTypeOptions.tippy().hide()
|
||||
}
|
||||
"
|
||||
/>
|
||||
<SmartItem
|
||||
@@ -78,8 +86,10 @@
|
||||
: 'radio_button_unchecked'
|
||||
"
|
||||
@click.native="
|
||||
authType = 'api-key'
|
||||
$refs.authTypeOptions.tippy().hide()
|
||||
() => {
|
||||
authType = 'api-key'
|
||||
authTypeOptions.tippy().hide()
|
||||
}
|
||||
"
|
||||
/>
|
||||
</tippy>
|
||||
@@ -215,8 +225,10 @@
|
||||
"
|
||||
:label="'Headers'"
|
||||
@click.native="
|
||||
addTo = 'Headers'
|
||||
$refs.addToOptions.tippy().hide()
|
||||
() => {
|
||||
addTo = 'Headers'
|
||||
addToOptions.tippy().hide()
|
||||
}
|
||||
"
|
||||
/>
|
||||
<SmartItem
|
||||
@@ -227,8 +239,10 @@
|
||||
"
|
||||
:label="'Query params'"
|
||||
@click.native="
|
||||
addTo = 'Query params'
|
||||
$refs.addToOptions.tippy().hide()
|
||||
() => {
|
||||
addTo = 'Query params'
|
||||
addToOptions.tippy().hide()
|
||||
}
|
||||
"
|
||||
/>
|
||||
</tippy>
|
||||
@@ -253,7 +267,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, Ref } from "@nuxtjs/composition-api"
|
||||
import { computed, defineComponent, ref, Ref } from "@nuxtjs/composition-api"
|
||||
import {
|
||||
HoppRESTAuthBasic,
|
||||
HoppRESTAuthBearer,
|
||||
@@ -314,6 +328,8 @@ export default defineComponent({
|
||||
apiKey,
|
||||
apiValue,
|
||||
addTo,
|
||||
authTypeOptions: ref<any | null>(null),
|
||||
addToOptions: ref<any | null>(null),
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
trigger="click"
|
||||
theme="popover"
|
||||
arrow
|
||||
:on-shown="() => $refs.sendTippyActions.focus()"
|
||||
:on-shown="() => sendTippyActions.focus()"
|
||||
>
|
||||
<template #trigger>
|
||||
<ButtonPrimary class="rounded-l-none" filled svg="chevron-down" />
|
||||
@@ -78,12 +78,13 @@
|
||||
ref="sendTippyActions"
|
||||
class="flex flex-col focus:outline-none"
|
||||
tabindex="0"
|
||||
@keyup.c="$refs.import.$el.click()"
|
||||
@keyup.s="$refs.show.$el.click()"
|
||||
@keyup.delete="$refs.clearAll.$el.click()"
|
||||
@keyup.c="curl.$el.click()"
|
||||
@keyup.s="show.$el.click()"
|
||||
@keyup.delete="clearAll.$el.click()"
|
||||
@keyup.escape="sendOptions.tippy().hide()"
|
||||
>
|
||||
<SmartItem
|
||||
ref="import"
|
||||
ref="curl"
|
||||
:label="`${t('import.curl')}`"
|
||||
svg="file-code"
|
||||
:shortcut="['C']"
|
||||
@@ -139,7 +140,7 @@
|
||||
trigger="click"
|
||||
theme="popover"
|
||||
arrow
|
||||
:on-shown="() => $refs.saveTippyActions.focus()"
|
||||
:on-shown="() => saveTippyActions.focus()"
|
||||
>
|
||||
<template #trigger>
|
||||
<ButtonSecondary
|
||||
@@ -152,8 +153,9 @@
|
||||
ref="saveTippyActions"
|
||||
class="flex flex-col focus:outline-none"
|
||||
tabindex="0"
|
||||
@keyup.c="$refs.copyRequest.$el.click()"
|
||||
@keyup.s="$refs.saveRequest.$el.click()"
|
||||
@keyup.c="copyRequestAction.$el.click()"
|
||||
@keyup.s="saveRequestAction.$el.click()"
|
||||
@keyup.escape="saveOptions.tippy().hide()"
|
||||
>
|
||||
<input
|
||||
id="request-name"
|
||||
@@ -166,7 +168,7 @@
|
||||
@keyup.enter="saveOptions.tippy().hide()"
|
||||
/>
|
||||
<SmartItem
|
||||
ref="copyRequest"
|
||||
ref="copyRequestAction"
|
||||
:label="shareButtonText"
|
||||
:svg="copyLinkIcon"
|
||||
:loading="fetchingShareLink"
|
||||
@@ -178,7 +180,7 @@
|
||||
"
|
||||
/>
|
||||
<SmartItem
|
||||
ref="saveRequest"
|
||||
ref="saveRequestAction"
|
||||
:label="`${t('request.save_as')}`"
|
||||
svg="folder-plus"
|
||||
:shortcut="['S']"
|
||||
@@ -279,6 +281,13 @@ const hasNavigatorShare = !!navigator.share
|
||||
const methodOptions = ref<any | null>(null)
|
||||
const saveOptions = ref<any | null>(null)
|
||||
const sendOptions = ref<any | null>(null)
|
||||
const sendTippyActions = ref<any | null>(null)
|
||||
const saveTippyActions = ref<any | null>(null)
|
||||
const curl = ref<any | null>(null)
|
||||
const show = ref<any | null>(null)
|
||||
const clearAll = ref<any | null>(null)
|
||||
const copyRequestAction = ref<any | null>(null)
|
||||
const saveRequestAction = ref<any | null>(null)
|
||||
|
||||
// Update Nuxt Loading bar
|
||||
watch(loading, () => {
|
||||
|
||||
Reference in New Issue
Block a user