T11c: Pull-to-refresh + swipe gestures implemented
+15
@@ -170,3 +170,18 @@ When building_number is entered in the manual asset form or location form, it au
|
||||
## Links
|
||||
- [README](https://gitea.ourpad.casa/shawn/canteen-asset-tracker/src/branch/main/README.md)
|
||||
- [PROJECT.md](https://gitea.ourpad.casa/shawn/canteen-asset-tracker/src/branch/main/PROJECT.md)
|
||||
|
||||
## T11c - Pull-to-Refresh + Swipe Gestures
|
||||
|
||||
**Date:** 2026-05-21
|
||||
|
||||
Mobile touch gesture support for the asset list:
|
||||
|
||||
- **Pull-to-refresh:** touchstart/touchmove/touchend on `#assetsListView` with visual pull indicator (spinner, drag progress, "Release to refresh" label). Only activates when scrolled to top.
|
||||
- **Swipe-to-delete:** Left-swipe on `.asset-item-swipe-wrap` items reveals delete background. Swipe past 60px threshold to activate, snap-back otherwise.
|
||||
- **Undo toast:** After delete, `#undoToast` appears at bottom with 5-second auto-dismiss. Undo button cancels the deletion.
|
||||
- **Desktop fallback:** `body.has-mouse` class shows a 🔄 Refresh button in the toolbar. Mouse detection via mousemove event.
|
||||
- **Gesture isolation:** PTR only triggers at scroll top; swipe requires horizontal movement (rejects vertical scroll).
|
||||
- **Idempotent init:** `_ptrInited` and `_swipeInited` guards prevent duplicate event listeners on tab switches.
|
||||
|
||||
**Implementation:** Single consolidated implementation replacing 2 prior conflicting versions. Removed duplicate `let ptrState` declaration that caused SyntaxError.
|
||||
|
||||
Reference in New Issue
Block a user