|
@@ -383,6 +383,11 @@ export default class SignatureFields extends Base {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ selectAnnotation () {
|
|
|
|
+ if (this.layer.selectedElementName === this.annotation.name) return
|
|
|
|
+ this.handleClick()
|
|
|
|
+ }
|
|
|
|
+
|
|
handleClick (event) {
|
|
handleClick (event) {
|
|
if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target) || this.layer.toolMode === 'editor' || document.getElementById("sign-image-save")) return
|
|
if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target) || this.layer.toolMode === 'editor' || document.getElementById("sign-image-save")) return
|
|
if (this.isDigital) return
|
|
if (this.isDigital) return
|
|
@@ -399,18 +404,14 @@ export default class SignatureFields extends Base {
|
|
}
|
|
}
|
|
|
|
|
|
handleOutside () {
|
|
handleOutside () {
|
|
- if (!this.hidden && this.layer.annotationStore.selectedElementName === this.annotation.name) {
|
|
|
|
- this.layer.annotationStore.selectedElementName = null
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
this.hidden = true
|
|
this.hidden = true
|
|
|
|
|
|
if (this.layer.annotationStore.selectedElementName === this.annotation.name) {
|
|
if (this.layer.annotationStore.selectedElementName === this.annotation.name) {
|
|
this.layer.annotationStore.selectedElementName = null
|
|
this.layer.annotationStore.selectedElementName = null
|
|
}
|
|
}
|
|
- this.outerLine.removeEventListener('mousedown', this.onMousedown)
|
|
|
|
- this.outerLine.removeEventListener('touchstart', this.onMousedown)
|
|
|
|
- this.outerLineContainer.remove()
|
|
|
|
|
|
+ this.outerLine?.removeEventListener('mousedown', this.onMousedown)
|
|
|
|
+ this.outerLine?.removeEventListener('touchstart', this.onMousedown)
|
|
|
|
+ this.outerLineContainer?.remove()
|
|
}
|
|
}
|
|
|
|
|
|
handleMouseDown (event) {
|
|
handleMouseDown (event) {
|
|
@@ -567,15 +568,12 @@ export default class SignatureFields extends Base {
|
|
|
|
|
|
handleDelete (data) {
|
|
handleDelete (data) {
|
|
const event = data instanceof Event ? data : null
|
|
const event = data instanceof Event ? data : null
|
|
- if (!this.annotationContainer) return
|
|
|
|
if (!event && data && data.signaturePtr !== this.annotation.signaturePtr) return
|
|
if (!event && data && data.signaturePtr !== this.annotation.signaturePtr) return
|
|
if (this.layer.tool && event) {
|
|
if (this.layer.tool && event) {
|
|
event.stopPropagation()
|
|
event.stopPropagation()
|
|
}
|
|
}
|
|
- if (event) this.handleOutside()
|
|
|
|
- this.annotationContainer.remove()
|
|
|
|
|
|
|
|
- this.annotation.isDelete = true
|
|
|
|
|
|
+ this.delete()
|
|
const annotationData = {
|
|
const annotationData = {
|
|
type: 'delete',
|
|
type: 'delete',
|
|
annotation: {
|
|
annotation: {
|
|
@@ -588,6 +586,15 @@ export default class SignatureFields extends Base {
|
|
this.eventBus.dispatch('annotationChange', annotationData)
|
|
this.eventBus.dispatch('annotationChange', annotationData)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ delete () {
|
|
|
|
+ this.handleOutside()
|
|
|
|
+ this.annotationContainer?.remove()
|
|
|
|
+ this.annotation.isDelete = true
|
|
|
|
+ this.layer.deleteAnnotationInLayer({
|
|
|
|
+ name: this.annotation.name
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
handleMouseUp (event) {
|
|
handleMouseUp (event) {
|
|
if (event.button !== 0 && event.type === 'mouseup') return
|
|
if (event.button !== 0 && event.type === 'mouseup') return
|
|
if (this.layer.tool) {
|
|
if (this.layer.tool) {
|