mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
lock swipe
This commit is contained in:
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
|
||||
|
||||
|
||||
Reference in new issue
Block a user