|
@@ -383,6 +383,11 @@ export default class SignatureFields extends Base {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ selectAnnotation () {
|
|
|
+ if (this.layer.selectedElementName === this.annotation.name) return
|
|
|
+ this.handleClick()
|
|
|
+ }
|
|
|
+
|
|
|
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.isDigital) return
|
|
@@ -399,18 +404,14 @@ export default class SignatureFields extends Base {
|
|
|
}
|
|
|
|
|
|
handleOutside () {
|
|
|
- if (!this.hidden && this.layer.annotationStore.selectedElementName === this.annotation.name) {
|
|
|
- this.layer.annotationStore.selectedElementName = null
|
|
|
- }
|
|
|
-
|
|
|
this.hidden = true
|
|
|
|
|
|
if (this.layer.annotationStore.selectedElementName === this.annotation.name) {
|
|
|
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) {
|
|
@@ -567,15 +568,12 @@ export default class SignatureFields extends Base {
|
|
|
|
|
|
handleDelete (data) {
|
|
|
const event = data instanceof Event ? data : null
|
|
|
- if (!this.annotationContainer) return
|
|
|
if (!event && data && data.signaturePtr !== this.annotation.signaturePtr) return
|
|
|
if (this.layer.tool && event) {
|
|
|
event.stopPropagation()
|
|
|
}
|
|
|
- if (event) this.handleOutside()
|
|
|
- this.annotationContainer.remove()
|
|
|
|
|
|
- this.annotation.isDelete = true
|
|
|
+ this.delete()
|
|
|
const annotationData = {
|
|
|
type: 'delete',
|
|
|
annotation: {
|
|
@@ -588,6 +586,15 @@ export default class SignatureFields extends Base {
|
|
|
this.eventBus.dispatch('annotationChange', annotationData)
|
|
|
}
|
|
|
|
|
|
+ delete () {
|
|
|
+ this.handleOutside()
|
|
|
+ this.annotationContainer?.remove()
|
|
|
+ this.annotation.isDelete = true
|
|
|
+ this.layer.deleteAnnotationInLayer({
|
|
|
+ name: this.annotation.name
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
handleMouseUp (event) {
|
|
|
if (event.button !== 0 && event.type === 'mouseup') return
|
|
|
if (this.layer.tool) {
|