Skip to content

Commit

Permalink
update fixTma and unfixTma methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kolirt committed Jun 17, 2024
1 parent 20fe2cb commit c9a80ef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions lib/helpers/fixTma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ const options = { passive: false }
let ts: any
let scrollableEl: HTMLElement | null

function ignore(e: TouchEvent) {
e.preventDefault()
}

function onTouchStart(e: TouchEvent) {
ts = e.touches[0].clientY
}
Expand Down Expand Up @@ -43,14 +39,10 @@ export function fixTma(el: HTMLElement | null) {
window.addEventListener('scroll', onScroll)
document.documentElement.addEventListener('touchstart', onTouchStart, options)
document.documentElement.addEventListener('touchmove', onTouchMove, options)
document.body.addEventListener('touchcancel', ignore, options)
document.body.addEventListener('touchend', ignore, options)
}

export function unfixTma() {
window.removeEventListener('scroll', onScroll)
document.documentElement.removeEventListener('touchstart', onTouchStart)
document.documentElement.removeEventListener('touchmove', onTouchMove)
document.body.removeEventListener('touchcancel', ignore)
document.body.removeEventListener('touchend', ignore)
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kolirt/vue-telegram-mini-app",
"version": "0.0.4",
"version": "0.0.5",
"type": "module",
"description": "Vue 3 telegram mini app package",
"author": "kolirt",
Expand Down

0 comments on commit c9a80ef

Please sign in to comment.