diff --git a/app/javascript/elements/clipboard_copy.js b/app/javascript/elements/clipboard_copy.js index d0b83a12..da7b9ec3 100644 --- a/app/javascript/elements/clipboard_copy.js +++ b/app/javascript/elements/clipboard_copy.js @@ -1,5 +1,7 @@ export default class extends HTMLElement { connectedCallback () { + this.clearChecked() + this.addEventListener('click', (e) => { e.stopPropagation() @@ -7,7 +9,7 @@ export default class extends HTMLElement { }) } - disconnectedCallback () { + clearChecked () { this.querySelectorAll('input').forEach((e) => { e.checked = false }) diff --git a/app/javascript/template_builder/area.vue b/app/javascript/template_builder/area.vue index 6b1a543d..4e10d2f4 100644 --- a/app/javascript/template_builder/area.vue +++ b/app/javascript/template_builder/area.vue @@ -240,8 +240,8 @@ export default { this.save() }, onResizeCell (e) { - if (e.toElement.id === 'mask') { - const positionX = e.layerX / (e.toElement.clientWidth - 1) + if (e.target.id === 'mask') { + const positionX = e.layerX / (e.target.clientWidth - 1) if (positionX > this.area.x) { this.area.cell_w = positionX - this.area.x @@ -282,17 +282,17 @@ export default { this.$refs.name.blur() }, resize (e) { - if (e.toElement.id === 'mask') { - this.area.w = e.layerX / e.toElement.clientWidth - this.area.x - this.area.h = e.layerY / e.toElement.clientHeight - this.area.y + if (e.target.id === 'mask') { + this.area.w = e.layerX / e.target.clientWidth - this.area.x + this.area.h = e.layerY / e.target.clientHeight - this.area.y } }, drag (e) { - if (e.toElement.id === 'mask') { + if (e.target.id === 'mask') { this.isDragged = true - this.area.x = (e.layerX - this.dragFrom.x) / e.toElement.clientWidth - this.area.y = (e.layerY - this.dragFrom.y) / e.toElement.clientHeight + this.area.x = (e.layerX - this.dragFrom.x) / e.target.clientWidth + this.area.y = (e.layerY - this.dragFrom.y) / e.target.clientHeight } }, startDrag (e) { diff --git a/app/javascript/template_builder/builder.vue b/app/javascript/template_builder/builder.vue index 51bf35b3..38c4527d 100644 --- a/app/javascript/template_builder/builder.vue +++ b/app/javascript/template_builder/builder.vue @@ -431,8 +431,6 @@ export default { } }), headers: { 'Content-Type': 'application/json' } - }).then((resp) => { - console.log(resp) }) } } diff --git a/app/javascript/template_builder/field_submitter.vue b/app/javascript/template_builder/field_submitter.vue index ac6e24e1..016e8b01 100644 --- a/app/javascript/template_builder/field_submitter.vue +++ b/app/javascript/template_builder/field_submitter.vue @@ -4,7 +4,7 @@ v-if="compact" tabindex="0" :title="selectedSubmitter.name" - class="cursor-pointer text-base-100" + class="cursor-pointer text-base-100 flex h-full items-center justify-center" > <% else %> - <%= render 'shared/clipboard_copy', text: submit_form_url(slug: submission.submitters.first.slug), class: 'btn btn-sm btn-neutral text-white w-36 flex', icon_class: 'w-6 h-6 text-white', copy_title: 'Copy Link' %> + <%= render 'shared/clipboard_copy', text: submit_form_url(slug: submitter.slug), class: 'btn btn-sm btn-neutral text-white w-36 flex', icon_class: 'w-6 h-6 text-white', copy_title: 'Copy Link' %> <% end %> - <%= button_to submitter.completed_at? ? 'Archive' : 'Remove', submission_path(submission), class: 'btn btn-outline btn-sm w-28', title: 'Delete', method: :delete, data: { turbo_confirm: 'Are you sure?' }, onclick: 'event.stopPropagation()' %> + <%= button_to button_title(title: submitter.completed_at? ? 'Archive' : 'Remove', disabled_with: 'Remov'), submission_path(submission), class: 'btn btn-outline btn-sm w-28', title: 'Delete', method: :delete, data: { turbo_confirm: 'Are you sure?' }, onclick: 'event.stopPropagation()' %> <% else %>
- <% submission.template.submitters.each_with_index do |item, index| %> - <% submitter = submission.submitters.find { |e| e.uuid == item['uuid'] } %> + <% submitters.each_with_index do |submitter, index| %>
<%= render 'icons/user_number', class: 'w-6 h-6 stroke-2', number: index + 1 %> @@ -86,7 +86,7 @@ <%= submitter.email %> - <% unless submission.submitters.all?(&:completed_at?) %> + <% unless submitters.all?(&:completed_at?) %>