lock swipe

This commit is contained in:
Pete Matsyburka committed 2026-09-23 11:00:17 +03:00
1 parent 5d3369d556
commit f4d2fa4c28
4 files changed
+12 -4

No files matched your search

@@ -5,6 +5,8 @@ export default targetable(class extends HTMLElement {
static [target.static] = ['canvas', 'input', 'clear', 'button']
async connectedCallback () {
this.lockSwipe(true)
const { default: SignaturePad } = await import('signature_pad')
this.setCanvasSize()
@@ -61,11 +63,17 @@ export default targetable(class extends HTMLElement {
}
disconnectedCallback () {
this.lockSwipe(false)
if (this.resizeObserver) {
this.resizeObserver.disconnect()
}
}
lockSwipe (locked) {
window.webkit?.messageHandlers?.native?.postMessage({ type: 'swipe', op: locked ? 'lock' : 'unlock' })
}
setCanvasSize () {
const scale = 3