mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
fix (image): remove console warning
This commit is contained in:
parent
6bf291a582
commit
cdd0f3567a
2 changed files with 3 additions and 5 deletions
|
|
@ -105,18 +105,16 @@ function initMobileNavigation({ $img, $navigation }) {
|
||||||
dist: null,
|
dist: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
effect(rxjs.fromEvent($img, "touchstart").pipe(rxjs.debounceTime(10), rxjs.tap((event) => {
|
effect(rxjs.fromEvent($img, "touchstart", { passive: true }).pipe(rxjs.debounceTime(10), rxjs.tap((event) => {
|
||||||
if (event.touches.length !== 1) return;
|
if (event.touches.length !== 1) return;
|
||||||
event.preventDefault();
|
|
||||||
$img.style.transition = "0s ease transform";
|
$img.style.transition = "0s ease transform";
|
||||||
state.active = true;
|
state.active = true;
|
||||||
state.originT = performance.now();
|
state.originT = performance.now();
|
||||||
state.originX = event.touches[0].pageX;
|
state.originX = event.touches[0].pageX;
|
||||||
})));
|
})));
|
||||||
|
|
||||||
effect(rxjs.fromEvent($img, "touchmove").pipe(rxjs.tap((event) => {
|
effect(rxjs.fromEvent($img, "touchmove", { passive: true }).pipe(rxjs.tap((event) => {
|
||||||
if (event.touches.length !== 1 || state.active === false) return;
|
if (event.touches.length !== 1 || state.active === false) return;
|
||||||
event.preventDefault();
|
|
||||||
state.dist = event.touches[0].pageX - state.originX;
|
state.dist = event.touches[0].pageX - state.originX;
|
||||||
$img.style.transform = `translateX(${state.dist}px)`;
|
$img.style.transform = `translateX(${state.dist}px)`;
|
||||||
})));
|
})));
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ function builder({ $img }) {
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
// pinch zoom
|
// pinch zoom
|
||||||
rxjs.fromEvent($img.parentElement, "touchstart").pipe(
|
rxjs.fromEvent($img.parentElement, "touchstart", { passive: false }).pipe(
|
||||||
rxjs.filter((e) => e.touches.length === 2),
|
rxjs.filter((e) => e.touches.length === 2),
|
||||||
rxjs.switchMap((event) => rxjs.fromEvent($img.parentElement, "touchmove").pipe(
|
rxjs.switchMap((event) => rxjs.fromEvent($img.parentElement, "touchmove").pipe(
|
||||||
rxjs.filter((event) => event.touches.length >= 2),
|
rxjs.filter((event) => event.touches.length >= 2),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue