mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-13 17:22:54 -05:00
Adjustments for touch
This commit is contained in:
@@ -20,10 +20,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function stopProgress() {
|
function stopProgress() {
|
||||||
resetProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
function resetProgress() {
|
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
@@ -36,7 +32,7 @@
|
|||||||
if (current.value >= props.duration) {
|
if (current.value >= props.duration) {
|
||||||
emit('longPress');
|
emit('longPress');
|
||||||
|
|
||||||
resetProgress();
|
stopProgress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,13 +47,14 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<button
|
<button
|
||||||
:class="{ 'loading-button': loading }"
|
class="long-press-button"
|
||||||
|
:class="{ loading: loading }"
|
||||||
@pointerdown="startProgress"
|
@pointerdown="startProgress"
|
||||||
@pointerup="stopProgress">
|
@pointerup="stopProgress"
|
||||||
|
@pointercancel="stopProgress">
|
||||||
<span v-show="!loading">
|
<span v-show="!loading">
|
||||||
<slot name="default"></slot>
|
<slot name="default"></slot>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<v-progress-circular
|
<v-progress-circular
|
||||||
v-if="loading"
|
v-if="loading"
|
||||||
:size="props.progressSize"
|
:size="props.progressSize"
|
||||||
@@ -66,11 +63,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.loading-button {
|
.long-press-button {
|
||||||
|
touch-action: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
touch-action: none;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user