mirror of https://github.com/docusealco/docuseal
parent
f1da37d1ec
commit
b5b4f286cf
@ -1,5 +1,18 @@
|
||||
export default class extends HTMLElement {
|
||||
setValue (value) {
|
||||
this.innerHTML = value
|
||||
const { fieldType } = this.dataset
|
||||
|
||||
if (fieldType === 'signature') {
|
||||
[...this.children].forEach(e => e.remove())
|
||||
|
||||
const img = document.createElement('img')
|
||||
|
||||
img.classList.add('w-full', 'h-full', 'object-contain')
|
||||
img.src = value.url
|
||||
|
||||
this.append(img)
|
||||
} else {
|
||||
this.innerHTML = value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,3 +1,8 @@
|
||||
<flow-area data-field-uuid="<%= field['uuid'] %>" data-action="click:flow-view#focusField" data-targets="flow-view.areas" class=" cursor-pointer bg-red-100 absolute" style="width: <%= area['w'] * 100 %>%; height: <%= area['h'] * 100 %>%; left: <%= area['x'] * 100 %>%; top: <%= area['y'] * 100 %>%">
|
||||
<%= submission.values[field['uuid']] %>
|
||||
<% value = submission.values[field['uuid']] %>
|
||||
<flow-area data-field-type="<%= field['type'] %>" data-field-uuid="<%= field['uuid'] %>" data-action="click:flow-view#focusField" data-targets="flow-view.areas" class="flex cursor-pointer bg-red-100 absolute" style="width: <%= area['w'] * 100 %>%; height: <%= area['h'] * 100 %>%; left: <%= area['x'] * 100 %>%; top: <%= area['y'] * 100 %>%">
|
||||
<% if field['type'] == 'signature' && attachment = attachments.find { |a| a.uuid == value } %>
|
||||
<img class="w-full h-full object-contain" src="<%= attachment.url %>" width="<%= attachment.metadata['width'] %>px" height="<%= attachment.metadata['height'] %>px">
|
||||
<% else %>
|
||||
<%= value %>
|
||||
<% end %>
|
||||
</flow-area>
|
||||
|
||||
Loading…
Reference in new issue