mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-12-19 19:06:16 +01:00
fix touch events (#11265)
This commit is contained in:
parent
306c11d730
commit
c0073db859
@ -187,7 +187,7 @@ export function SummaryTimeline({
|
||||
e.stopPropagation();
|
||||
|
||||
let clientY;
|
||||
if (e.nativeEvent instanceof TouchEvent) {
|
||||
if ("TouchEvent" in window && e.nativeEvent instanceof TouchEvent) {
|
||||
clientY = e.nativeEvent.touches[0].clientY;
|
||||
} else if (e.nativeEvent instanceof MouseEvent) {
|
||||
clientY = e.nativeEvent.clientY;
|
||||
@ -238,7 +238,7 @@ export function SummaryTimeline({
|
||||
setIsDragging(true);
|
||||
|
||||
let clientY;
|
||||
if (e.nativeEvent instanceof TouchEvent) {
|
||||
if ("TouchEvent" in window && e.nativeEvent instanceof TouchEvent) {
|
||||
clientY = e.nativeEvent.touches[0].clientY;
|
||||
} else if (e.nativeEvent instanceof MouseEvent) {
|
||||
clientY = e.nativeEvent.clientY;
|
||||
@ -276,7 +276,7 @@ export function SummaryTimeline({
|
||||
}
|
||||
e.stopPropagation();
|
||||
let clientY;
|
||||
if (e instanceof TouchEvent) {
|
||||
if ("TouchEvent" in window && e instanceof TouchEvent) {
|
||||
clientY = e.touches[0].clientY;
|
||||
} else if (e instanceof MouseEvent) {
|
||||
clientY = e.clientY;
|
||||
|
@ -87,7 +87,7 @@ function useDraggableElement({
|
||||
const getClientYPosition = useCallback(
|
||||
(e: MouseEvent | TouchEvent) => {
|
||||
let clientY;
|
||||
if (e instanceof TouchEvent) {
|
||||
if ("TouchEvent" in window && e instanceof TouchEvent) {
|
||||
clientY = e.touches[0].clientY;
|
||||
} else if (e instanceof MouseEvent) {
|
||||
clientY = e.clientY;
|
||||
@ -113,7 +113,7 @@ function useDraggableElement({
|
||||
setIsDragging(true);
|
||||
|
||||
let clientY;
|
||||
if (e.nativeEvent instanceof TouchEvent) {
|
||||
if ("TouchEvent" in window && e.nativeEvent instanceof TouchEvent) {
|
||||
clientY = e.nativeEvent.touches[0].clientY;
|
||||
} else if (e.nativeEvent instanceof MouseEvent) {
|
||||
clientY = e.nativeEvent.clientY;
|
||||
|
@ -98,7 +98,7 @@ export default function LiveCameraView({ camera }: LiveCameraViewProps) {
|
||||
|
||||
let clientX;
|
||||
let clientY;
|
||||
if (e.nativeEvent instanceof TouchEvent) {
|
||||
if ("TouchEvent" in window && e.nativeEvent instanceof TouchEvent) {
|
||||
clientX = e.nativeEvent.touches[0].clientX;
|
||||
clientY = e.nativeEvent.touches[0].clientY;
|
||||
} else if (e.nativeEvent instanceof MouseEvent) {
|
||||
|
Loading…
Reference in New Issue
Block a user