diff --git a/src/components/Project.vue b/src/components/Project.vue
index 0230a17..6cb6ed0 100644
--- a/src/components/Project.vue
+++ b/src/components/Project.vue
@@ -229,14 +229,6 @@ export default {
v-model:base-map="baseMap"
:terrain-enabled="terrainEnabled"
/>
-
onPanelToggle('right', bIsOpen, iAnimDuration)"
/>
+
-
+
diff --git a/src/components/ProjectFeed.vue b/src/components/ProjectFeed.vue
index 7e50ba5..d1ad4ac 100644
--- a/src/components/ProjectFeed.vue
+++ b/src/components/ProjectFeed.vue
@@ -3,6 +3,7 @@ import Simplebar from 'simplebar-vue';
import AppIcon from '@components/AppIcon';
import ProjectPost from '@components/ProjectPost';
+import { createSwipeToClose, initialSwipeState } from '@scripts/swipeToClose';
export default {
components: {
@@ -26,7 +27,7 @@ export default {
isOpen: false,
posts: [],
refreshRate: 60,
- swipe: {x: null, y: null}
+ swipe: initialSwipeState()
};
},
emits: ['request-last-update', 'new-markers', 'toggle'],
@@ -76,7 +77,6 @@ export default {
this.refIdLast = 0;
this.firstChunk = true;
this.posts = [];
- this.swipe = {x: null, y: null};
this.toggle(!this.isMobile(), 0);
this.getScrollElement().scrollTop = 0;
@@ -162,23 +162,7 @@ export default {
if((box.scrollTop + box.clientHeight) / (content?.offsetHeight || 1) >= 0.8) this.getNextFeed();
},
- onTouchStart(oEvent) {
- if(!this.isMobile() || !this.isOpen || oEvent.touches.length != 1) return;
-
- const oTouch = oEvent.touches[0];
- this.swipe = {x: oTouch.clientX, y: oTouch.clientY};
- },
- onTouchEnd(oEvent) {
- const oTouch = oEvent.changedTouches[0];
- if(!oTouch || this.swipe.x === null) return;
-
- const iDeltaX = oTouch.clientX - this.swipe.x;
- const iDeltaY = oTouch.clientY - this.swipe.y;
-
- if(iDeltaX > 80 && Math.abs(iDeltaX) > Math.abs(iDeltaY) * 1.5) this.toggle();
-
- this.swipe = {x: null, y: null};
- },
+ ...createSwipeToClose(1),
setUpdateTimer(iSeconds) {
if(typeof this.feedTimer != 'undefined') clearTimeout(this.feedTimer);
if(iSeconds >= 0) this.feedTimer = setTimeout(this.onUpdateTimer, iSeconds * 1000);
@@ -224,7 +208,7 @@ export default {
-