do not add checkbox on click

pull/133/head
Alex Turchyn 2 years ago
parent 54592e7264
commit 9bcf5aacc0

@ -391,6 +391,10 @@ export default {
this.drawField.areas.push(area) this.drawField.areas.push(area)
this.drawField = null this.drawField = null
this.selectedAreaRef.value = area
this.save()
} else { } else {
const documentRef = this.documentRefs.find((e) => e.document.uuid === area.attachment_uuid) const documentRef = this.documentRefs.find((e) => e.document.uuid === area.attachment_uuid)
const pageMask = documentRef.pageRefs[area.page].$refs.mask const pageMask = documentRef.pageRefs[area.page].$refs.mask
@ -401,6 +405,7 @@ export default {
const previousField = [...this.template.fields].reverse().find((f) => f.type === type) const previousField = [...this.template.fields].reverse().find((f) => f.type === type)
const previousArea = previousField?.areas?.[previousField.areas.length - 1] const previousArea = previousField?.areas?.[previousField.areas.length - 1]
if (previousArea || area.w) {
const areaW = previousArea?.w || (30 / pageMask.clientWidth) const areaW = previousArea?.w || (30 / pageMask.clientWidth)
const areaH = previousArea?.h || (30 / pageMask.clientHeight) const areaH = previousArea?.h || (30 / pageMask.clientHeight)
@ -412,7 +417,9 @@ export default {
area.w = areaW area.w = areaW
area.h = areaH area.h = areaH
} }
}
if (area.w) {
const field = { const field = {
name: '', name: '',
uuid: v4(), uuid: v4(),
@ -423,11 +430,12 @@ export default {
} }
this.template.fields.push(field) this.template.fields.push(field)
}
this.selectedAreaRef.value = area this.selectedAreaRef.value = area
this.save() this.save()
}
}
}, },
onDropfield (area) { onDropfield (area) {
const field = { const field = {

Loading…
Cancel
Save