draw field on field type click
This commit is contained in:
@@ -217,14 +217,22 @@
|
|||||||
<p>
|
<p>
|
||||||
{{ t('draw_field_on_the_document').replace('{field}', drawField.name) }}
|
{{ t('draw_field_on_the_document').replace('{field}', drawField.name) }}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="base-button"
|
class="base-button"
|
||||||
@click="[drawField = null, drawOption = null]"
|
@click="clearDrawField"
|
||||||
>
|
>
|
||||||
{{ t('cancel') }}
|
{{ t('cancel') }}
|
||||||
</button>
|
</button>
|
||||||
</p>
|
<a
|
||||||
|
v-if="!drawOption && !drawField.areas.length && !['stamp', 'signature', 'initials'].includes(drawField.type)"
|
||||||
|
href="#"
|
||||||
|
class="link block mt-3 text-sm"
|
||||||
|
@click.prevent="[drawField = null, drawOption = null]"
|
||||||
|
>
|
||||||
|
{{ t('or_add_field_without_drawing') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@@ -577,10 +585,21 @@ export default {
|
|||||||
|
|
||||||
ref.$el.scrollIntoView({ behavior: 'smooth', block: 'start' })
|
ref.$el.scrollIntoView({ behavior: 'smooth', block: 'start' })
|
||||||
},
|
},
|
||||||
|
clearDrawField () {
|
||||||
|
if (this.drawField && !this.drawOption && this.drawField.areas.length === 0) {
|
||||||
|
const fieldIndex = this.template.fields.indexOf(this.drawField)
|
||||||
|
|
||||||
|
if (fieldIndex !== -1) {
|
||||||
|
this.template.fields.splice(fieldIndex, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.drawField = null
|
||||||
|
this.drawOption = null
|
||||||
|
},
|
||||||
onKeyUp (e) {
|
onKeyUp (e) {
|
||||||
if (e.code === 'Escape') {
|
if (e.code === 'Escape') {
|
||||||
this.drawField = null
|
this.clearDrawField()
|
||||||
this.drawOption = null
|
|
||||||
this.selectedAreaRef.value = null
|
this.selectedAreaRef.value = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,7 @@
|
|||||||
Drag & drop any other field type on the page
|
Drag & drop any other field type on the page
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Click on the field type above to add it to the form without drawing it on the document
|
Click on the field type above to start drawing it
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -295,7 +295,7 @@ export default {
|
|||||||
|
|
||||||
this.fields.push(field)
|
this.fields.push(field)
|
||||||
|
|
||||||
if (['signature', 'initials', 'cells', 'stamp'].includes(type)) {
|
if (!['payment', 'file'].includes(type)) {
|
||||||
this.$emit('set-draw', { field })
|
this.$emit('set-draw', { field })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ const en = {
|
|||||||
ninth_party: 'Ninth Party',
|
ninth_party: 'Ninth Party',
|
||||||
tenth_party: 'Tenth Party',
|
tenth_party: 'Tenth Party',
|
||||||
add: 'Add',
|
add: 'Add',
|
||||||
|
or_add_field_without_drawing: 'Or add field without drawing',
|
||||||
text: 'Text',
|
text: 'Text',
|
||||||
signature: 'Signature',
|
signature: 'Signature',
|
||||||
initials: 'Initials',
|
initials: 'Initials',
|
||||||
|
|||||||
Reference in New Issue
Block a user