mirror of
https://github.com/docusealco/docuseal
synced 2026-11-07 23:32:33 -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']
|
static [target.static] = ['canvas', 'input', 'clear', 'button']
|
||||||
|
|
||||||
async connectedCallback () {
|
async connectedCallback () {
|
||||||
|
this.lockSwipe(true)
|
||||||
|
|
||||||
const { default: SignaturePad } = await import('signature_pad')
|
const { default: SignaturePad } = await import('signature_pad')
|
||||||
|
|
||||||
this.setCanvasSize()
|
this.setCanvasSize()
|
||||||
@@ -61,11 +63,17 @@ export default targetable(class extends HTMLElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
disconnectedCallback () {
|
disconnectedCallback () {
|
||||||
|
this.lockSwipe(false)
|
||||||
|
|
||||||
if (this.resizeObserver) {
|
if (this.resizeObserver) {
|
||||||
this.resizeObserver.disconnect()
|
this.resizeObserver.disconnect()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lockSwipe (locked) {
|
||||||
|
window.webkit?.messageHandlers?.native?.postMessage({ type: 'swipe', op: locked ? 'lock' : 'unlock' })
|
||||||
|
}
|
||||||
|
|
||||||
setCanvasSize () {
|
setCanvasSize () {
|
||||||
const scale = 3
|
const scale = 3
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
<img src="<%= signature.url(time: ActiveStorage::Attachment.service_url_time) %>" style="height: 130px; width: 100%; object-fit: contain;">
|
<img src="<%= signature.url(time: ActiveStorage::Attachment.service_url_time) %>" style="height: 130px; width: 100%; object-fit: contain;">
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<a href="<%= edit_user_signature_path %>" data-turbo-frame="modal" class="base-button w-full">
|
<a href="<%= edit_user_signature_path %>" data-turbo-frame="modal" data-native-modal="medium" class="base-button w-full">
|
||||||
<%= t('update_signature') %>
|
<%= t('update_signature') %>
|
||||||
</a>
|
</a>
|
||||||
<p class="text-2xl font-bold mt-8 mb-4">
|
<p class="text-2xl font-bold mt-8 mb-4">
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
<img src="<%= initials.url(time: ActiveStorage::Attachment.service_url_time) %>" style="height: 130px; width: 100%; object-fit: contain;">
|
<img src="<%= initials.url(time: ActiveStorage::Attachment.service_url_time) %>" style="height: 130px; width: 100%; object-fit: contain;">
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<a href="<%= edit_user_initials_path %>" data-turbo-frame="modal" class="base-button w-full">
|
<a href="<%= edit_user_initials_path %>" data-turbo-frame="modal" data-native-modal="medium" class="base-button w-full">
|
||||||
<%= t('update_initials') %>
|
<%= t('update_initials') %>
|
||||||
</a>
|
</a>
|
||||||
<% if true_user == current_user && !current_account.testing? %>
|
<% if true_user == current_user && !current_account.testing? %>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<%= render 'shared/turbo_modal', title: t('update_initials') do %>
|
<%= render 'shared/turbo_modal', title: t('update_initials') do %>
|
||||||
<% options = [[t('draw'), 'draw'], [t('upload'), 'upload']] %>
|
<% options = [[t('draw'), 'draw'], [t('upload'), 'upload']] %>
|
||||||
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center mt-4 block">
|
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center block <%= 'mt-4' unless turbo_native_app? %>">
|
||||||
<div class="join">
|
<div class="join">
|
||||||
<% options.each_with_index do |(label, value), index| %>
|
<% options.each_with_index do |(label, value), index| %>
|
||||||
<span>
|
<span>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<%= render 'shared/turbo_modal', title: t('update_signature') do %>
|
<%= render 'shared/turbo_modal', title: t('update_signature') do %>
|
||||||
<% options = [[t('draw'), 'draw'], [t('upload'), 'upload']] %>
|
<% options = [[t('draw'), 'draw'], [t('upload'), 'upload']] %>
|
||||||
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center mt-4 block">
|
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center block <%= 'mt-4' unless turbo_native_app? %>">
|
||||||
<div class="join">
|
<div class="join">
|
||||||
<% options.each_with_index do |(label, value), index| %>
|
<% options.each_with_index do |(label, value), index| %>
|
||||||
<span>
|
<span>
|
||||||
|
|||||||
Reference in new issue
Block a user